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
收信人 Arfrever, amaury.forgeotdarc, ezio.melotti, lemburg, loewis, vstinner
日期 2010-03-05.12:56:15
SpamBayes Score 9.554294e-08
Marked as misclassified
Message-id <1267793777.34.0.337116244426.issue6697@psf.upfronthosting.co.za>
In-reply-to
内容
Patch for pythonrun.c:
 - catch _PyUnicode_AsString() error in get_codeset(): very unlikely, codeset is the result of nl_langinfo() and is ASCII only
 - catch _PyUnicode_AsString(sys.stdin.encoding) error in PyRun_InteractiveOneFlags()
 - use _PyUnicode_AsStringOrDefault() for ps1 and ps2: use ps1="" and/or ps2="" on unicode error. I don't know if it's the best option. Display the error is maybe a better idea.

It's possible to raise to test the error on sys.stdin.encoding by adding the following lines to site.py:

class Stdin: pass
sys.stdin = Stdin()
sys.stdin = "\xdc80"

See also #8070: PyRun_InteractiveLoopFlags() doesn't handle errors :-/
历史
日期 用户 动作 参数
2010-03-05 12:56:17vstinner修改recipients: + vstinner, lemburg, loewis, amaury.forgeotdarc, ezio.melotti, Arfrever
2010-03-05 12:56:17vstinner修改messageid: <1267793777.34.0.337116244426.issue6697@psf.upfronthosting.co.za>
2010-03-05 12:56:16vstinner链接issue6697 messages
2010-03-05 12:56:15vstinner创建