gh-133448: Fix test_file in test_urllib2 on Windows with a longer repo path#133449
gh-133448: Fix test_file in test_urllib2 on Windows with a longer repo path#133449aisk wants to merge 4 commits intopython:mainfrom
Conversation
|
@aisk NB: The review would go a lot faster if you were to add a short PR description of your changes |
|
@sharktide Thanks for noticing, updated! |
sharktide
left a comment
There was a problem hiding this comment.
I know this is kinda a stupid question, but have you tested this new version of your test script on a windows long path? (I know people who wouldn't not saying its you just trying to expedite the core review process then) :)
*GitHub Actions won't fail because it is a short path.
Sorry I just missed this. This bug is found on my local machine with a longer checkout path, and after this change it has been fixed. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
This test tries to create two invalid file URLs: with a port after "localhost", and with random internet host. It does not work correctly on Windows, but the fix is not correct either. The drive name should not be ignored, and some escaping is needed. pathname2url() can be used to create a valid URL which should then be mutilated.
Also note that the test creates the file in a loop -- this is not necessary.
|
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 |
Thanks for the view, updated! |
Before this PR, the
urlwould become something likefile://somerandomhost.ontheinternet.comC:\Users\xxxxx\Source\cpython\build\test_python_worker_4676æ/@test_4676_tmpæon Windows, which would fail (more details in the linked issue).In this PR, the
urlbecomesfile://somerandomhost.ontheinternet.com/Users/xxxxx/Source/cpython/build/test_python_worker_4676æ/@test_4676_tmpæ, which is valid and expected.test_filefailed on Windows with a longer repo path intest_urllib2#133448