Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open('existing_dir') -> IOError instance's attr filename is None #49014

Closed
zuo mannequin opened this issue Dec 29, 2008 · 2 comments
Closed

open('existing_dir') -> IOError instance's attr filename is None #49014

zuo mannequin opened this issue Dec 29, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@zuo
Copy link
Mannequin

zuo mannequin commented Dec 29, 2008

BPO 4764
Nosy @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-12-29.17:57:18.854>
created_at = <Date 2008-12-29.01:03:51.680>
labels = ['type-bug', 'library']
title = "open('existing_dir') -> IOError instance's attr filename is None"
updated_at = <Date 2008-12-29.17:57:18.853>
user = 'https://bugs.python.org/zuo'

bugs.python.org fields:

activity = <Date 2008-12-29.17:57:18.853>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2008-12-29.17:57:18.854>
closer = 'benjamin.peterson'
components = ['Library (Lib)']
creation = <Date 2008-12-29.01:03:51.680>
creator = 'zuo'
dependencies = []
files = []
hgrepos = []
issue_num = 4764
keywords = []
message_count = 2.0
messages = ['78437', '78469']
nosy_count = 2.0
nosy_names = ['benjamin.peterson', 'zuo']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue4764'
versions = ['Python 2.5', 'Python 2.4', 'Python 3.0']

@zuo
Copy link
Mannequin Author

zuo mannequin commented Dec 29, 2008

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 bpo-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 (Support "bpo-" in Misc/NEWS #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)

@zuo zuo mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 29, 2008
@benjaminp
Copy link
Contributor

Fixed in r68014 and r68016.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant