New submission from Jan Kaliszewski <z...@chopin.edu.pl>: Py2.4 and 2.5 (and probably other 2.x releases too): >>> try: f=open('existing_dir') ... except IOError, exc: print exc.filename ... None (expected result: "existing_dir")
Py3.0 (and possibly 3.1 too): >>> try: f=open('existing_dir') ... except IOError as exc: print(exc.filename) ... None (expected result: "existing_dir") But no problems with: open('existing_dir', 'w') => exc.filename=='existing_dir' open('not_existing_file') => exc.filename=='not_existing_file' Guess: It may be similar to issue #599163 Platform/system info: [GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2 Linux 2.6.25-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz * Py2.4 == Python 2.4.4 (#1, Oct 7 2008, 13:16:18) * Py2.5 == Python 2.5.2 (r252:60911, Sep 15 2008, 12:11:51) * Py3.0 == Python 3.0 (r30:67503, Dec 29 2008, 01:15:48) ---------- components: Library (Lib) messages: 78437 nosy: zuo severity: normal status: open title: open('existing_dir') -> IOError instance's attr filename is None type: behavior versions: Python 2.4, Python 2.5, Python 3.0 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4764> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com