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.

作者 vstinner
收信人 vstinner
日期 2010-04-20.12:02:52
SpamBayes Score 1.9658542e-06
Marked as misclassified
Message-id <1271764975.75.0.223846589239.issue8467@psf.upfronthosting.co.za>
In-reply-to
内容
On a non-Windows OS where _posixsubprocess is missing (subprocess uses the pure Python implementation), if the child fails with a Python exception and the exception message contains a surrogate character, message.encode() fails silently (exception while processing exceptions are just ignored).

Surrogates should be passed to the parent process: surrogatepass can be used for that. Attached patch implements this idea with an unit test.

--

_posixsubprocess is not concerned because it writes an empty message for OSError (the parent process calls os.strerror() to get the message) or "Exception occurred in preexec_fn." (pure ASCII string) for RuntimeError.

On Windows, _subprocess.CreateProcess() calls PyErr_SetFromWindowsErr() on failure without the filename. So there is no surrogates here.
历史
日期 用户 动作 参数
2010-04-20 12:02:55vstinner修改recipients: + vstinner
2010-04-20 12:02:55vstinner修改messageid: <1271764975.75.0.223846589239.issue8467@psf.upfronthosting.co.za>
2010-04-20 12:02:54vstinner链接issue8467 messages
2010-04-20 12:02:53vstinner创建