-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
gh-76646: Fix proxy_bypass_registry trailing semicolon on Windows #138172
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
base: main
Are you sure you want to change the base?
gh-76646: Fix proxy_bypass_registry trailing semicolon on Windows #138172
Conversation
- _proxy_bypass_winreg_override now strips empty values from ProxyOverride - Added unit test ProxyBypassRegistryTests to check trailing semicolon behavior
Hi, I’ve implemented the fix for #76646 (_proxy_bypass_winreg_override trailing semicolon issue) and added the corresponding unit test in test_urllib.py.
However, the CI keeps failing with bedevere/news — News entry not in an appropriate directory even though the file is correctly placed. Could you please guide me on what I might be missing or if there’s a way to get the NEWS check to pass? Any help would be greatly appreciated! |
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.
Review PEP 8, the style guide for the standard language. Notably, we use underscores to separate words in variable names, which are themselves lowercase.
You may also find the Python Developer's Guide instructive.
A
Lib/urllib/request.py
Outdated
@@ -1996,7 +1996,7 @@ def ip2num(ipAddr): | |||
|
|||
|
|||
# Same as _proxy_bypass_macosx_sysconf, testable on all platforms | |||
def _proxy_bypass_winreg_override(host, override): | |||
def _proxy_bypass_winreg_override(host, proxyOverride): |
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.
Why?
Lib/urllib/request.py
Outdated
proxy_override = override.split(';') | ||
for test in proxy_override: | ||
test = test.strip() |
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.
This code is clearer. If the fix is to skip empty entries, just add ``if not test: continue`.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
You must use the blurb tool. I advise a close reading of the devguide. |
Thank you for the review and helpful feedback. |
Problem:
Fix:
_proxy_bypass_winreg_override
, strip empty entries from ProxyOverride.proxy_bypass
behaves correctly on Windows when registry value ends with ';'.Test:
ProxyBypassRegistryTests
intest_urllib_proxy_bypass.py
notmatching.com
) returns Falselocalhost
andsub.example.com
) return TrueAll tests pass locally:
python -m test test_urllib -v
✅