Author ysj.ray
Recipients jnoller, nikratio, ysj.ray
Date 2010-08-01.14:04:25
SpamBayes Score 1.2059e-05
Marked as misclassified No
Message-id <1280671475.54.0.234252371984.issue9400@psf.upfronthosting.co.za>
In-reply-to
Content
This is because when an subprocess.CalledProcessError is raised, the CalledProcessError instance is picked through a socket and then read by "parent" process, but in fact CalledProcessError instances cannot be picked correctly. Because CalledProcessError extends PyExc_BaseException, which defines a __reduce__ method, that special method cause the pickle load to call the exception type's __init__ method with packed self.args as arguments. So if a subclass of "Exception" needs to behave correctly in pickling, it should make self.args meats its __init__ method's function signature. That is, ensure the calling to:
          self.__init__(*self.args)
has no problem. 

But CalledProcessError doesn't meat this requirement. Here is a patch fixing the CalledProcessError.__init__ to call its base class's __init__ to store its arguments in self.args, which can fix this bug.
History
Date User Action Args
2010-08-01 14:04:35ysj.raysetrecipients: + ysj.ray, jnoller, nikratio
2010-08-01 14:04:35ysj.raysetmessageid: <1280671475.54.0.234252371984.issue9400@psf.upfronthosting.co.za>
2010-08-01 14:04:27ysj.raylinkissue9400 messages
2010-08-01 14:04:26ysj.raycreate