Comment 1 for bug 683031

Revision history for this message
Eric Moyer (eric-moyer) wrote :

This may be related: If you have a from future print import and you run pythoscope --init, the resulting pickle files crash pythoscope on load when you try to run pythoscope again.

To reproduce, put a python file with the from future bug and one that analyzes fine in the same directory.

run pythoscope --init

pythoscope will complain with a warning:
WARNING: Inspection of module <bad_module_here> failed.

Then run pythoscope good_module.py

I get the following traceback:

ERROR: Oops, it seems that an internal Pythoscope error occurred. Please file a bug report at https://bugs.launchpad.net/pythoscope

Traceback (most recent call last):
  File "/usr/local/bin/pythoscope", line 9, in <module>
    load_entry_point('pythoscope==0.4.3', 'console_scripts', 'pythoscope')()
  File "/usr/local/lib/python2.7/dist-packages/pythoscope/__init__.py", line 190, in main
    generate_tests(args, force, template)
  File "/usr/local/lib/python2.7/dist-packages/pythoscope/__init__.py", line 117, in generate_tests
    project = Project.from_directory(find_project_directory(modules[0]))
  File "/usr/local/lib/python2.7/dist-packages/pythoscope/store.py", line 69, in from_directory
    project = load_pickle_from(get_pickle_path(project_path))
  File "/usr/local/lib/python2.7/dist-packages/pythoscope/util.py", line 365, in load_pickle_from
    obj = cPickle.load(fd)
TypeError: ('__init__() takes exactly 5 arguments (2 given)', <class 'lib2to3.pgen2.parse.ParseError'>, ("bad input: type=22, value='=', context=(' ', (182, 23))",))

I'm running pythoscope 0.4.3