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 Taywee
Recipients Taywee
Date 2016-05-13.16:59:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463158749.5.0.182634970623.issue27015@psf.upfronthosting.co.za>
In-reply-to
Content
When using kwargs to construct a CalledProcessError, the repr doesn't show those args, and using kwargs also breaks pickling:

>>> import pickle; from subprocess import CalledProcessError
>>> CalledProcessError(2, 'foo')
CalledProcessError(2, 'foo')
>>> CalledProcessError(2, 'foo').returncode
2
>>> CalledProcessError(2, 'foo').cmd
'foo'
>>> CalledProcessError(returncode=2, cmd='foo')
CalledProcessError()
>>> CalledProcessError(returncode=2, cmd='foo').returncode
2
>>> CalledProcessError(returncode=2, cmd='foo').cmd
'foo'
>>> pickle.loads(pickle.dumps(CalledProcessError(2, 'foo')))
CalledProcessError(2, 'foo')
>>> pickle.loads(pickle.dumps(CalledProcessError(returncode=2, cmd='foo')))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() missing 2 required positional arguments: 'returncode' and 'cmd'
>>>
History
Date User Action Args
2016-05-13 16:59:09Tayweesetrecipients: + Taywee
2016-05-13 16:59:09Tayweesetmessageid: <1463158749.5.0.182634970623.issue27015@psf.upfronthosting.co.za>
2016-05-13 16:59:09Tayweelinkissue27015 messages
2016-05-13 16:59:09Tayweecreate