print function imported from __future__ causes inspection to fail

Bug #683031 reported by Daniel Lee
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pythoscope
Confirmed
Medium
Unassigned

Bug Description

e.g.
'''
test.py
'''
from __future__ import print_function

class Class(object):
    def method(self):
        print('foo', end=' ')

WARNING: Inspection of module path\test.py failed.

description: updated
Changed in pythoscope:
importance: Undecided → Medium
status: New → Confirmed
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

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.