-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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-43564: preserve original exception in args of FTP URLError #24938
Conversation
This PR is stale because it has been open for 30 days with no activity. |
* main: (5519 commits) Minor edits to the Descriptor HowTo Guide (pythonGH-24901) Fix link to Lifecycle of a Pull Request in CONTRIBUTING (python#98102) pythonGH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and `MultiLoopChildWatcher` child watchers (python#98089) Auto-cancel old builds when new commit pushed to branch (python#98009) pythongh-95011: Migrate syslog module to Argument Clinic (pythonGH-95012) pythongh-68686: Retire eptag ptag scripts (python#98064) pythongh-97922: Run the GC only on eval breaker (python#97920) GitHub Workflows security hardening (python#96492) Add `@ezio-melotti` as codeowner for `.github/`. (python#98079) pythongh-97913 Docs: Add walrus operator to the index (python#97921) [doc] Fix broken links to C extensions accelerating stdlib modules (python#96914) pythongh-97822: Fix http.server documentation reference to test() function (python#98027) pythongh-91052: Add PyDict_Unwatch for unwatching a dictionary (python#98055) pythonGH-98023: Change default child watcher to PidfdChildWatcher on supported systems (python#98024) pythonGH-94182: Run the PidfdChildWatcher on the running loop (python#94184) pythongh-92886: make test_ast pass with -O (assertions off) (pythonGH-98058) pythongh-92886: make test_coroutines pass with -O (assertions off) (pythonGH-98060) pythongh-57179: Add note on symlinks for os.walk (python#94799) pythongh-94808: Fix regex on exotic platforms (python#98036) pythongh-90085: Remove vestigial -t and -c timeit options (python#94941) ...
I re-checked this change and I believe it is still correct/useful. The conditions for this to cause a test suite failure are a bit more subtle than described in the issue. If the network is totally unavailable, then the gethostbyname call will fail at Line 1558 in aeb28f5
test.support.transient_internet handles correctly.
In order to reproduce this problem, you need a host where there is a network and DNS available (so Line 1568 in aeb28f5
test.support.transient_internet , and is fixed in this PR.
Without such a host, you can verify this fix by manually adding Line 1588 in aeb28f5
./python.exe -m test test_urllib2net -u network will then fail. With this fix, it will pass and skip the FTP tests due to test.support.transient_internet .
|
Requesting review from @orsenthil, listed in experts index as expert for urllib. |
* main: pythongh-97841: Add methoddef for _filters_mutated (pythongh-98115)
Looks like a right candidate to back port to other supported branches. important change for CI |
Thanks @carljm for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry @carljm and @orsenthil, I had trouble checking out the |
Sorry, @carljm and @orsenthil, I could not cleanly backport this to |
Thanks @carljm for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry @carljm and @orsenthil, I had trouble checking out the |
Thanks @carljm for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-98136 is a backport of this pull request to the 3.11 branch. |
…nGH-24938) * bpo-43564: preserve original error in args of FTP URLError * Add NEWS blurb Co-authored-by: Carl Meyer <carljm@instagram.com> (cherry picked from commit ad817cd) Co-authored-by: Carl Meyer <carl@oddbird.net>
Thanks @carljm for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, @carljm and @orsenthil, I could not cleanly backport this to |
GH-98138 is a backport of this pull request to the 3.10 branch. |
…n#24938) * bpo-43564: preserve original error in args of FTP URLError * Add NEWS blurb Co-authored-by: Carl Meyer <carljm@instagram.com>
This makes this case consistent with the other cases in this module where an
OSError
is caught and wrapped and re-raised as aURLError
, in that the original exception is preserved in the args of theURLError
for introspection by the caller.In particular, this means that
test.support.transient_internet
works with these wrapped errors, so that the FTP urllib2net tests correctly skip instead of failing when the network is not reachable.https://bugs.python.org/issue43564