Patches item #1630975, was opened at 2007-01-08 23:55 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1630975&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core (C code) Group: None Status: Open Resolution: None Priority: 9 Private: No Submitted By: Thomas Wouters (twouters) Assigned to: Neal Norwitz (nnorwitz) Summary: Fix crash when replacing sys.stdout in sitecustomize Initial Comment: When replacing sys.stdout, stderr and/or stdin with non-file, file-like objects in sitecustomize, and also having an environment that makes Python set the encoding of those streams, Python will crash. PyFile_SetEncoding() will be called after sys.stdout/stderr/stdin are replaced, passing the non-file objects. Fix by not calling PyFile_SetEncoding() in these cases. I'm not entirely sure if we should warn or not; not setting encoding only for replaced streams may cause a disconnect between stdout and stderr that's hard to explain, when someone only replaces one of them (in sitecustomize.) Then again, not many people must be doing it, as it currently just crashes. No idea how to test for this, from a unittest :P ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1630975&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches