Bug 1323516 - Loading a pxp file results in TypeError: list indices must be integers, not str
Summary: Loading a pxp file results in TypeError: list indices must be integers, not str
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-igor
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-03 20:42 UTC by Jonathan Underwood
Modified: 2017-12-12 10:52 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:52:45 UTC
Type: Bug


Attachments (Terms of Use)

Description Jonathan Underwood 2016-04-03 20:42:35 UTC
Description of problem:

Simply loading a pxp file like this:

import igor
igor.packed.load('160401_02.pxp')

results in:

/usr/lib/python2.7/site-packages/igor/packed.pyc in load(filename, strict, ignore_unknown)
    103                 raise KeyError('unkown record type {}'.format(
    104                         header['recordType']))
--> 105             records.append(record_type(header, data, byte_order=byte_order))
    106     finally:
    107         _LOG.debug('finished loading {} records from {}'.format(

/usr/lib/python2.7/site-packages/igor/record/variables.pyc in __init__(self, *args, **kwargs)
    311         VariablesRecordStructure.setup()
    312         stream = _io.BytesIO(bytes(self.data))
--> 313         self.variables = VariablesRecordStructure.unpack_stream(stream)
    314         self.namespace = {}
    315         for key,value in self.variables['variables'].items():

/usr/lib/python2.7/site-packages/igor/struct.pyc in unpack_stream(self, stream, parents, data, d)
    767                         d[f.name] = {}
    768                         f.format.unpack_stream(
--> 769                             stream, parents=parents, data=data, d=d[f.name])
    770                     if hasattr(f, 'post_unpack'):
    771                         _LOG.debug('post-unpack {}'.format(f))

/usr/lib/python2.7/site-packages/igor/struct.pyc in unpack_stream(self, stream, parents, data, d)
    762                             d[f.name].append(x)
    763                             f.format.unpack_stream(
--> 764                                 stream, parents=parents, data=data, d=x)
    765                     else:
    766                         assert f.item_count == 1, (f, f.count)

/usr/lib/python2.7/site-packages/igor/struct.pyc in unpack_stream(self, stream, parents, data, d)
    743             if hasattr(f, 'pre_unpack'):
    744                 _LOG.debug('pre-unpack {}'.format(f))
--> 745                 f.pre_unpack(parents=parents, data=data)
    746 
    747             if hasattr(f, 'unpack'):  # override default unpacking

/usr/lib/python2.7/site-packages/igor/binarywave.pyc in pre_unpack(self, parents, data)
    364 
    365     def pre_unpack(self, parents, data):
--> 366         size = self._get_size_data(parents, data)
    367         if self._array_size_field:
    368             self.counts = size

/usr/lib/python2.7/site-packages/igor/binarywave.pyc in _get_size_data(self, parents, data)
    375         wave_structure = parents[-1]
    376         wave_data = self._get_structure_data(parents, data, wave_structure)
--> 377         bin_header = wave_data['bin_header']
    378         return bin_header[self._size_field]
    379 

TypeError: list indices must be integers, not str



Version-Release number of selected component (if applicable):
$ rpm -q python2-igor
python2-igor-0.2-4.20150408git2c2a79d.fc23.noarch

Comment 1 Jonathan Underwood 2016-04-03 21:29:55 UTC
Same thing with python3:

$ python3
Python 3.4.3 (default, Jun 29 2015, 12:16:01) 
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import igor.packed as ip
>>> ip.load('160401_02.pxp')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/igor/packed.py", line 105, in load
    records.append(record_type(header, data, byte_order=byte_order))
  File "/usr/lib/python3.4/site-packages/igor/record/variables.py", line 313, in __init__
    self.variables = VariablesRecordStructure.unpack_stream(stream)
  File "/usr/lib/python3.4/site-packages/igor/struct.py", line 769, in unpack_stream
    stream, parents=parents, data=data, d=d[f.name])
  File "/usr/lib/python3.4/site-packages/igor/struct.py", line 764, in unpack_stream
    stream, parents=parents, data=data, d=x)
  File "/usr/lib/python3.4/site-packages/igor/struct.py", line 745, in unpack_stream
    f.pre_unpack(parents=parents, data=data)
  File "/usr/lib/python3.4/site-packages/igor/binarywave.py", line 366, in pre_unpack
    size = self._get_size_data(parents, data)
  File "/usr/lib/python3.4/site-packages/igor/binarywave.py", line 377, in _get_size_data
    bin_header = wave_data['bin_header']
TypeError: list indices must be integers, not str

Comment 2 Fedora End Of Life 2016-11-25 07:14:09 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2017-11-16 19:41:36 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-12-12 10:52:45 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.