Improper handling of empty .json files

Bug #1389352 reported by Paul Tiplady
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Meliae
New
Undecided
Unassigned

Bug Description

paul@ubuntu:~/gulfstream/systemtest$ touch /tmp/pyrasite-59506-objects.json
paul@ubuntu:~/gulfstream/systemtest$ ../env/bin/pyrasite-memory-viewer 59506
Traceback (most recent call last):
  File "../env/bin/pyrasite-memory-viewer", line 9, in <module>
    load_entry_point('pyrasite==2.0', 'console_scripts', 'pyrasite-memory-viewer')()
  File "/home/paul/gulfstream/env/local/lib/python2.7/site-packages/pyrasite/tools/memory_viewer.py", line 150, in main
    objects = loader.load(filename)
  File "/home/paul/gulfstream/env/local/lib/python2.7/site-packages/meliae/loader.py", line 542, in load
    max_parents=max_parents)
  File "/home/paul/gulfstream/env/local/lib/python2.7/site-packages/meliae/loader.py", line 621, in _load
    factory=objs.add):
  File "/home/paul/gulfstream/env/local/lib/python2.7/site-packages/meliae/loader.py", line 615, in iter_objs
    % (line_num, len(objs), mb_read, input_mb, tdelta))
UnboundLocalError: local variable 'line_num' referenced before assignment

This error case should probably be handled in an assert, rather than silently assuming that the file has lines and then blowing up later .

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.