[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Geoff Gilmour-Taylor
Geoff Gilmour-Taylor <[EMAIL PROTECTED]> added the comment: Cheers. First bug I've found in 5 years of Python. (Or, 5 years in and I still keep forgetting to use raw strings for Windows paths. :) ___ Python tracker <[EMAIL PROTECTED]>

[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: And, thanks a lot reporting this! ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Pyth

[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Applied patch in r66620, with the suggested change in the error message. -- keywords: -needs review resolution: accepted -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]

[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: I think it is somewhat surprising that the file name shows up at the end in the traceback. Instead of getting IOError: [Errno 22] invalid filename or mode 'w': '/dos/foo\n' it might be better if it said IOError: [Errno 22] invalid mode ('w

[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Confirmed here. This also happens on Windows when the mode is invalid: open(u"foobar", "rr") Here is a patch, please review. The problem does not affect py3k because open() is used in place of fopen(), and the mode string is parsed

[issue3965] 2.6rc2 crashes when trying to open unicode filename with unprintables

2008-09-25 Thread Geoff Gilmour-Taylor
New submission from Geoff Gilmour-Taylor <[EMAIL PROTECTED]>: In 2.6rc2, when I try to open a file with a unicode filename with a tab in it, Python crashes on Win2000 and WinXP. Bytestrings raise an IOError as expected. I'm using the Windows ia32 binaries. C:\>c:\python26\python Python 2.6rc2