This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bpb
Recipients alexandre.vassalotti, belopolsky, bpb, brett.cannon, ehuss, facundobatista, georg.brandl, gvanrossum, jafo, jaraco, jarpa, kylev, loewis, nnorwitz, tseaver, vstinner, zseil
Date 2011-04-12.13:52:51
SpamBayes Score 1.6350314e-09
Marked as misclassified No
Message-id <1302616372.35.0.53865462248.issue1692335@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps this should be addressed separately, but subprocess.CalledProcessError is subject to this problem (can't be unpickled) (it has separate returncode and cmd attributes, but no args).

It's straightforward to conform user-defined Exceptions to including .args and having reasonable __init__ functions, but not possible in the case of stdlib exceptions.

>>> import subprocess, pickle
>>> try:
...   subprocess.check_call('/bin/false')
... except Exception as e:
...   pickle.loads(pickle.dumps(e))
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python3.1/subprocess.py", line 435, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/bin/false' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/usr/lib/python3.1/pickle.py", line 1363, in loads
    encoding=encoding, errors=errors).load()
TypeError: __init__() takes at least 3 positional arguments (1 given)
History
Date User Action Args
2011-04-12 13:52:52bpbsetrecipients: + bpb, gvanrossum, loewis, nnorwitz, brett.cannon, georg.brandl, facundobatista, jafo, ehuss, tseaver, jaraco, belopolsky, zseil, vstinner, alexandre.vassalotti, jarpa, kylev
2011-04-12 13:52:52bpbsetmessageid: <1302616372.35.0.53865462248.issue1692335@psf.upfronthosting.co.za>
2011-04-12 13:52:51bpblinkissue1692335 messages
2011-04-12 13:52:51bpbcreate