]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport trunk revision 53527:
authorThomas Wouters <thomas@python.org>
Tue, 23 Jan 2007 15:09:19 +0000 (15:09 +0000)
committerThomas Wouters <thomas@python.org>
Tue, 23 Jan 2007 15:09:19 +0000 (15:09 +0000)
commit1e42ab6e434044fdfcdc99b5b631ed972825a92c
treeaac6ac06981e283a12b2308d278a97dfb5edc110
parent741e0bb5f46588ad71d3ac940a430e46e8d77df1
Backport trunk revision 53527:

SF patch #1630975: Fix crash when replacing sys.stdout in sitecustomize

When running the interpreter in an environment that would cause it to set
stdout/stderr/stdin's encoding, having a sitecustomize that would replace
them with something other than PyFile objects would crash the interpreter.
Fix it by simply ignoring the encoding-setting for non-files.

This could do with a test, but I can think of no maintainable and portable
way to test this bug, short of adding a sitecustomize.py to the buildsystem
and have it always run with it (hmmm....)
Misc/NEWS
Objects/fileobject.c
Python/pythonrun.c
Python/sysmodule.c