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.

作者 ysj.ray
收信人 jnoller, nikratio, ysj.ray
日期 2010-08-01.14:04:25
SpamBayes Score 1.2058998e-05
Marked as misclassified
Message-id <1280671475.54.0.234252371984.issue9400@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2010-08-01 14:04:35ysj.ray修改recipients: + ysj.ray, jnoller, nikratio
2010-08-01 14:04:35ysj.ray修改messageid: <1280671475.54.0.234252371984.issue9400@psf.upfronthosting.co.za>
2010-08-01 14:04:27ysj.ray链接issue9400 messages
2010-08-01 14:04:26ysj.ray创建