You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" #86105
For 3.9.0, test_site fails with an env changed warning:
Warning -- urllib.requests._opener was modified by test_site
Before: None
After: <urllib.request.OpenerDirector object at 0xb76f4f88>
test_site failed (env changed)
== Tests result: SUCCESS ==
1 test altered the execution environment:
test_site
The problem occurs in test_site's test_license_exists_at_url test and was introduced by the changes in bpo-37421: "Some tests leak temporary files".
This failure has not been noticed up to now because test_license_exists_at_url is skipped unless the build being tested is for a released branch, which is about to happen for 3.9 with the 3.9.0 release. The test failure can be reproduced on any build by commenting out Lib/test_site.py lines 503-504:
@unittest.skipUnless(sys.version_info[3] == 'final',
'only for released versions')
Setting to "deferred blocker" status for release manager evaluation.
Sometime after filing this, I remembered that we had seen a similar problem some years ago and found bpo-21572 in which I had changed Lib/site.py to no longer use a release-dependent URL for the license file - which is why the check to skip if on a pre-release had been added previously to test_license_exists_at_url. So I should have removed the skip in test_site at the same time as it is no longer needed and hides problems like this until the final release. PR 22688 and its backports remove the skip.
Activity
ned-deily commentedon Oct 5, 2020
For 3.9.0, test_site fails with an env changed warning:
Warning -- urllib.requests._opener was modified by test_site
Before: None
After: <urllib.request.OpenerDirector object at 0xb76f4f88>
test_site failed (env changed)
== Tests result: SUCCESS ==
1 test altered the execution environment:
test_site
The problem occurs in test_site's test_license_exists_at_url test and was introduced by the changes in bpo-37421: "Some tests leak temporary files".
This failure has not been noticed up to now because test_license_exists_at_url is skipped unless the build being tested is for a released branch, which is about to happen for 3.9 with the 3.9.0 release. The test failure can be reproduced on any build by commenting out Lib/test_site.py lines 503-504:
Setting to "deferred blocker" status for release manager evaluation.
vstinner commentedon Oct 5, 2020
It's a minor issue in the test itself, not in urllib. Such bug should not block a release.
vstinner commentedon Oct 5, 2020
I proposed PR 22559 to fix the issue.
See also bpo-37475: "What is urllib.request.urlcleanup() function?".
ambv commentedon Oct 5, 2020
New changeset 1fce240 by Victor Stinner in branch 'master':
bpo-41939: Fix test_site.test_license_exists_at_url() (bpo-22559)
1fce240
ambv commentedon Oct 5, 2020
New changeset 10b4136 by Miss Skeleton (bot) in branch '3.9':
bpo-41939: Fix test_site.test_license_exists_at_url() (GH-22559) (bpo-22567)
10b4136
miss-islington commentedon Oct 6, 2020
New changeset 78bddc7 by Miss Skeleton (bot) in branch '3.8':
bpo-41939: Fix test_site.test_license_exists_at_url() (GH-22559)
78bddc7
ned-deily commentedon Oct 14, 2020
New changeset 6a48518 by Ned Deily in branch 'master':
bpo-41939: always enable test_site.test_license_exists_at_url (GH-22688)
6a48518
miss-islington commentedon Oct 14, 2020
New changeset 8b4642d by Miss Skeleton (bot) in branch '3.8':
bpo-41939: always enable test_site.test_license_exists_at_url (GH-22688)
8b4642d
miss-islington commentedon Oct 14, 2020
New changeset 881a13c by Miss Skeleton (bot) in branch '3.9':
bpo-41939: always enable test_site.test_license_exists_at_url (GH-22688)
881a13c
ned-deily commentedon Oct 14, 2020
Thanks for the fix, Victor.
Sometime after filing this, I remembered that we had seen a similar problem some years ago and found bpo-21572 in which I had changed Lib/site.py to no longer use a release-dependent URL for the license file - which is why the check to skip if on a pre-release had been added previously to test_license_exists_at_url. So I should have removed the skip in test_site at the same time as it is no longer needed and hides problems like this until the final release. PR 22688 and its backports remove the skip.
vstinner commentedon Oct 14, 2020
You're welcome ;-)