Comment 5 for bug 271904

Revision history for this message
Michal Kwiatkowski (ruby) wrote :

OK, I nailed the problem. It seems the pickle module has problems with lib2to3.pgen2.parse.ParseError:

>>> import pickle
>>> from lib2to3.pgen2.parse import ParseError
>>> pickle.loads(pickle.dumps(ParseError(1, 2, 3, 4)))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/sw/all/Linux-x86_64/2.6/swhouse/python2_5.3.0/lib/python2.5/pickle.py", line 1374, in loads
    return Unpickler(file).load()
  File "/sw/all/Linux-x86_64/2.6/swhouse/python2_5.3.0/lib/python2.5/pickle.py", line 858, in load
    dispatch[key](self)
  File "/sw/all/Linux-x86_64/2.6/swhouse/python2_5.3.0/lib/python2.5/pickle.py", line 1133, in load_reduce
    value = func(*args)
TypeError: __init__() takes exactly 5 arguments (2 given)

This error manifests itself when one or more modules Pythoscope analyzes has syntax errors, thus making ParseError a part of the pickled object.