Message133581
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) |
|
Date |
User |
Action |
Args |
2011-04-12 13:52:52 | bpb | set | recipients:
+ 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:52 | bpb | set | messageid: <1302616372.35.0.53865462248.issue1692335@psf.upfronthosting.co.za> |
2011-04-12 13:52:51 | bpb | link | issue1692335 messages |
2011-04-12 13:52:51 | bpb | create | |
|