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

tempfile breaks on Windows #45651

Closed
tiran opened this issue Oct 22, 2007 · 2 comments
Closed

tempfile breaks on Windows #45651

tiran opened this issue Oct 22, 2007 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@tiran
Copy link
Member

tiran commented Oct 22, 2007

BPO 1310
Nosy @birkenfeld, @tiran

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 2007-10-22.12:42:56.527>
created_at = <Date 2007-10-22.02:23:03.526>
labels = ['type-bug', 'library']
title = 'tempfile breaks on Windows'
updated_at = <Date 2007-10-22.12:42:56.520>
user = 'https://github.com/tiran'

bugs.python.org fields:

activity = <Date 2007-10-22.12:42:56.520>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2007-10-22.12:42:56.527>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2007-10-22.02:23:03.526>
creator = 'christian.heimes'
dependencies = []
files = []
hgrepos = []
issue_num = 1310
keywords = ['patch']
message_count = 2.0
messages = ['56638', '56646']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'christian.heimes']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1310'
versions = ['Python 3.0']

@tiran
Copy link
Member Author

tiran commented Oct 22, 2007

tempfile breaks on Windows because exception objectss no longer support
e[0]. The fix is simple and short:

Index: Lib/tempfile.py
===================================================================

--- Lib/tempfile.py     (Revision 58587)
+++ Lib/tempfile.py     (Arbeitskopie)
@@ -201,7 +201,7 @@
                 del fp, fd
                 return dir
             except (OSError, IOError) as e:
-                if e[0] != _errno.EEXIST:
+                if e.args[0] != _errno.EEXIST:
                     break # no point trying more names in this directory
                 pass

@tiran tiran added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 22, 2007
@birkenfeld
Copy link
Member

Fixed in r58590.

@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

2 participants