-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
bpo-40459: Fix NameError in platform.py #19855
Changes from 6 commits
833e30a
4357154
a09be25
3003dd4
06c999a
29143c0
944a3b5
694fa07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix :exc:`NameError` caused from :func:`platform.win32_ver`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The NEWS entry doesn't really explain the behavior change for users. It seems like previously, ptype was always an empty string. ptype is now filled with the value of the "SOFTWARE\Microsoft\Windows NT\CurrentVersion" registry entry. Can someone test on Windows to see how this string look like? I'm curious :-) The documentation says:
https://docs.python.org/dev/library/platform.html#platform.win32_ver There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please explain that this change fix the ptype part of :func: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this bug was never seend because of "except: pass". It's maybe time to use more precise errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
except OSError:
acceptable? Or are there any situations where this would raise an exception other than anOSError
? And if so, is there a good reason why those are currently passing silently?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
win32_edition() doesn't have the typo and it uses "except OSError: pass", so yeah I think that "except OSError:" is reasonable here.