[issue20384] open() exception doesn't contain file name on Windows
New submission from Serhiy Storchaka: On Linux for 2.7, 3.3 and 3.4 the open of non-existing file raises an exception which contains file name. Python 2.7: open('non-existing', 'rb') Traceback (most recent call last): File stdin, line 1, in module IOError: [Errno 2] No such file or directory: 'non-existing' import io io.open('non-existing', 'rb') Traceback (most recent call last): File stdin, line 1, in module IOError: [Errno 2] No such file or directory: 'non-existing' Python 3.3 and 3.4: open('non-existing', 'rb') Traceback (most recent call last): File stdin, line 1, in module FileNotFoundError: [Errno 2] No such file or directory: 'non-existing' On Windows for 2.7 and 3.4 raised exception also contains file name. But on 3.3 error message is only [Errno 2] No such file or directory and doesn't contains file name. This change affects tests. test_tarfile failed on all Windows buildbots for 3.3. http://buildbot.python.org/all/builders/x86%20Windows7%203.3/builds/1252/steps/test/logs/stdio I suppose this is 3.3 bug. -- components: IO messages: 209109 nosy: benjamin.peterson, hynek, pitrou, serhiy.storchaka, stutzbach priority: normal severity: normal status: open title: open() exception doesn't contain file name on Windows type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Mark Lawrence added the comment: Not on my system, so what's changed? Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. open('non-existing', 'rb') Traceback (most recent call last): File stdin, line 1, in module FileNotFoundError: [Errno 2] No such file or directory: 'non-existing' -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Serhiy Storchaka added the comment: Mark, could you please try following commands? import tarfile; tarfile.open('non-existing', 'r|') -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +brian.curtin, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Mark Lawrence added the comment: Two attempts, one with the pipe | symbol in the mode, one without. import tarfile; tarfile.open('non-existing', 'r|') Traceback (most recent call last): File stdin, line 1, in module File C:\Python33\lib\tarfile.py, line 1594, in open stream = _Stream(name, filemode, comptype, fileobj, bufsize) File C:\Python33\lib\tarfile.py, line 362, in __init__ fileobj = _LowLevelFile(name, mode) File C:\Python33\lib\tarfile.py, line 335, in __init__ self.fd = os.open(name, mode, 0o666) FileNotFoundError: [Errno 2] No such file or directory import tarfile; tarfile.open('non-existing', 'r') Traceback (most recent call last): File stdin, line 1, in module File C:\Python33\lib\tarfile.py, line 1566, in open return func(name, r, fileobj, **kwargs) File C:\Python33\lib\tarfile.py, line 1614, in taropen return cls(name, mode, fileobj, **kwargs) File C:\Python33\lib\tarfile.py, line 1442, in __init__ fileobj = bltn_open(name, self._mode) FileNotFoundError: [Errno 2] No such file or directory: 'non-existing' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Serhiy Storchaka added the comment: Ah, here is os.open() raises an exception. Thank you Mark. On Linux it raises an exception with file name. import os; os.open('non-existing', os.O_RDONLY | getattr(os, 'O_BINARY', 0), 0x666) Traceback (most recent call last): File stdin, line 1, in module FileNotFoundError: [Errno 2] No such file or directory: 'non-existing' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Roundup Robot added the comment: New changeset 69d885ac042d by Serhiy Storchaka in branch '3.3': Issue #20384: Fix the test_tarfile test on Windows. http://hg.python.org/cpython/rev/69d885ac042d -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Mark Lawrence added the comment: I think there's a typo in the patch, test = 'xxx' but after the check for platform and mode, text = ''. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20384] open() exception doesn't contain file name on Windows
Serhiy Storchaka added the comment: Yes, thank you. It is alredy fixed in 38a50d8102be (thanks Arfrever). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20384 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com