Skip to content

gh-62917: Add tests for urllib.request.urlcleanup() - #155446

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-62917-urlcleanup-tests
Open

gh-62917: Add tests for urllib.request.urlcleanup()#155446
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-62917-urlcleanup-tests

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 9, 2026

Copy link
Copy Markdown
Member

Both side effects of urlcleanup() are covered: the temporary files created by urlretrieve() are removed (and a file recreated under the same name survives a repeated call), and the cached opener is reset, so an explicitly installed opener no longer applies afterwards.

No network is used -- FakeHTTPMixin serves the http responses, and the restricted opener is tested with a data: URL.

Test that it removes temporary files created by urlretrieve() and resets
the cached opener.
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Aug 9, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant