dlce-eva / python-nexus

python-nexus - Generic nexus (.nex, .trees) reader/writer for python
BSD 2-Clause "Simplified" License
11 stars 3 forks source link

UnboundLocalError: local variable 'found_ntaxa' referenced before assignment #1

Closed xrotwang closed 8 years ago

xrotwang commented 8 years ago

I just ran into this exception after upgrading python-nexus for dplace:

    reader = NexusReader(file_name)
  File "/home/robert/venvs/dplace/local/lib/python2.7/site-packages/nexus/reader.py", line 674, in __init__
    return self.read_file(filename)
  File "/home/robert/venvs/dplace/local/lib/python2.7/site-packages/nexus/reader.py", line 706, in read_file
    self._read(handle)
  File "/home/robert/venvs/dplace/local/lib/python2.7/site-packages/nexus/reader.py", line 751, in _read
    self._do_blocks()
  File "/home/robert/venvs/dplace/local/lib/python2.7/site-packages/nexus/reader.py", line 682, in _do_blocks
    self.blocks[block].parse(data)
  File "/home/robert/venvs/dplace/local/lib/python2.7/site-packages/nexus/reader.py", line 146, in parse
    if found_ntaxa != self.ntaxa:
UnboundLocalError: local variable 'found_ntaxa' referenced before assignment
SimonGreenhill commented 8 years ago

@xrotwang - can you send me the nexus file?

xrotwang commented 8 years ago

It's one of the files in dplace-data. Can check which tomorrow. Am 02.02.2016 22:40 schrieb "Simon J Greenhill" notifications@github.com:

@xrotwang https://github.com/xrotwang - can you send me the nexus file?

— Reply to this email directly or view it on GitHub https://github.com/SimonGreenhill/python-nexus/issues/1#issuecomment-178840302 .

SimonGreenhill commented 8 years ago

Fixed in v1.34 -- I'll upload to PYPI later.