This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_normalization doesn't work
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, berker.peksag, brett.cannon, iritkatriel, serhiy.storchaka, terry.reedy, vstinner
Priority: normal Keywords:

Created on 2017-03-23 16:57 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 905 merged vstinner, 2017-03-30 07:52
PR 1196 merged vstinner, 2017-04-20 00:03
PR 2271 merged Mariatta, 2017-06-19 03:31
PR 2272 merged Mariatta, 2017-06-19 03:31
PR 2275 merged vstinner, 2017-06-19 11:52
PR 2344 benjamin.peterson, 2017-06-23 05:11
Messages (15)
msg290053 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-23 16:57
It needs to fetch http://www.pythontest.net/unicode/9.0.0/NormalizationTest.txt (8.0.0 in 3.5) but get the 404 error.
msg290175 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-03-24 22:17
Fetching the file requires '-u urlfetch' or '-u all'.  For me, the test 'works' by skipping test_main.  Loading www.pythontest.net refers one to https://github.com/python/pythontestdotnet/.  Pinging contributors there.
msg290605 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-03-27 13:02
http://www.pythontest.net/unicode/7.0.0/NormalizationTest.txt exists, but not http://www.pythontest.net/unicode/8.0.0/NormalizationTest.txt nor http://www.pythontest.net/unicode/9.0.0/NormalizationTest.txt

Maybe the dev who upgrade Unicode to 8.0 and then 9.0 forgot to upload required files to the pythontest website?

I confirm that 8.0 and 9.0 lacks from https://github.com/python/pythontestdotnet/tree/master/www/unicode
msg290636 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2017-03-27 18:45
Benjamin did the update to 9.0.0.

We should probably update Tools/unicode/makeunicodedata.py to print out in the end that the appropriate file needs to be added to pythontest.net **before** merging an update to unicodedata.
msg290816 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-03-30 05:59
We should change the tests to fail if they get a 404.
msg290832 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-03-30 07:53
Benjamin: "We should change the tests to fail if they get a 404."

Good idea. Currently, the test is explicitly skipped on this case. Since "-u urlfetch" option must be explicitly passed on the command line, it makes sense to fail on that case.

I proposed https://github.com/python/cpython/pull/905 change for that. Not sure if it's worth to backport such change to older Python versions?
msg290848 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-03-30 15:06
New changeset 722a3af092b94983aa26f5e591fb1b45e2c2a0ff by Victor Stinner in branch 'master':
bpo-29887: Test normalization now fails if download fails (#905)
https://github.com/python/cpython/commit/722a3af092b94983aa26f5e591fb1b45e2c2a0ff
msg290878 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-03-30 19:57
Oh, Zachary reported me the following failure which is legitimate. The code doesn't handle correctly read-only library directory.

The test should try to write the file in a temporary file, or simply skip the test.

http://buildbot.python.org/all/builders/x86%20Gentoo%20Installed%20with%20X%203.x/builds/500/steps/test/logs/stdio

======================================================================
FAIL: test_main (test.test_normalization.NormalizationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/test/test_normalization.py", line 42, in test_main
    check=check_version)
PermissionError: [Errno 13] Permission denied: '/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/test/data/NormalizationTest.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/test/test_normalization.py", line 44, in test_main
    self.fail(f"Could not retrieve {TESTDATAURL}")
AssertionError: Could not retrieve http://www.pythontest.net/unicode/9.0.0/NormalizationTest.txt

----------------------------------------------------------------------
Ran 2 tests in 0.149s
msg291922 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-20 00:04
> The test should try to write the file in a temporary file, or simply skip the test.

I proposed https://github.com/python/cpython/pull/1196 to skip the test in that case.

Creating a temporary file is more complex since the API doesn't work as a context manager, and it's unclear who would be responsible to remove the temporary file.
msg291925 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-20 00:40
New changeset d13d54748d3a7db023d9db37223ea7d40bb8f8e3 by Victor Stinner in branch 'master':
bpo-29887: test_normalization handles PermissionError (#1196)
https://github.com/python/cpython/commit/d13d54748d3a7db023d9db37223ea7d40bb8f8e3
msg291932 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-20 01:45
Cool! "x86 Gentoo Installed with X 3.x" succeeded.
msg296310 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-19 11:22
New changeset 51f40a81a4acbc85cb1034750fb16cb1854b2315 by Victor Stinner (Mariatta) in branch '3.6':
[3.6] bpo-29887: Test normalization now fails if download fails (GH-905) (#2271)
https://github.com/python/cpython/commit/51f40a81a4acbc85cb1034750fb16cb1854b2315
msg296336 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-19 13:42
New changeset acdf159b245aaac28f54dd10606911386ab39058 by Victor Stinner in branch '3.6':
bpo-29887: test_normalization handles PermissionError (#1196) (#2275)
https://github.com/python/cpython/commit/acdf159b245aaac28f54dd10606911386ab39058
msg296404 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-20 06:31
New changeset 070ba85a8f45819d9197bce4541cd594d79d247c by Victor Stinner (Mariatta) in branch '3.5':
[3.5] bpo-29887: Test normalization now fails if download fails (GH-905) (#2272)
https://github.com/python/cpython/commit/070ba85a8f45819d9197bce4541cd594d79d247c
msg377163 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-09-19 11:48
Looks like this is complete and can be closed.
History
Date User Action Args
2022-04-11 14:58:44adminsetgithub: 74073
2020-09-19 14:10:07benjamin.petersonsetstatus: open -> closed
resolution: fixed
stage: backport needed -> resolved
2020-09-19 11:48:46iritkatrielsetnosy: + iritkatriel
messages: + msg377163
2017-06-23 05:11:42benjamin.petersonsetpull_requests: + pull_request2389
2017-06-20 06:31:13vstinnersetmessages: + msg296404
2017-06-19 13:42:47vstinnersetmessages: + msg296336
2017-06-19 11:52:24vstinnersetpull_requests: + pull_request2324
2017-06-19 11:22:57vstinnersetmessages: + msg296310
2017-06-19 03:31:54Mariattasetpull_requests: + pull_request2322
2017-06-19 03:31:50Mariattasetpull_requests: + pull_request2321
2017-04-26 02:53:57Mariattasetstage: backport needed
2017-04-20 01:45:36vstinnersetmessages: + msg291932
2017-04-20 00:40:01vstinnersetmessages: + msg291925
2017-04-20 00:04:43vstinnersetmessages: + msg291922
2017-04-20 00:03:28vstinnersetpull_requests: + pull_request1321
2017-03-30 19:57:21vstinnersetmessages: + msg290878
2017-03-30 15:06:55vstinnersetmessages: + msg290848
2017-03-30 07:53:44vstinnersetmessages: + msg290832
2017-03-30 07:52:21vstinnersetpull_requests: + pull_request805
2017-03-30 05:59:59benjamin.petersonsetmessages: + msg290816
2017-03-27 18:45:19brett.cannonsetmessages: + msg290636
2017-03-27 13:02:22vstinnersetnosy: + vstinner
messages: + msg290605
2017-03-24 22:17:41terry.reedysetnosy: + brett.cannon, terry.reedy, benjamin.peterson, berker.peksag
messages: + msg290175
2017-03-23 16:57:10serhiy.storchakacreate