FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-133448: Fix test_file in test_urllib2 on Windows with a longer repo path by aisk · Pull Request #133449 · python/cpython · GitHub

/ cpython Public

gh-133448: Fix test_file in test_urllib2 on Windows with a longer repo path - #133449

Open
aisk wants to merge 4 commits into
python:mainfrom
aisk:fix-urllib2-test
Open

gh-133448: Fix test_file in test_urllib2 on Windows with a longer repo path#133449
aisk wants to merge 4 commits into
python:mainfrom
aisk:fix-urllib2-test

Conversation

aisk commented May 5, 2025
edited
Loading

Copy link
Copy Markdown
Member

Before this PR, the url would become something like file://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 url becomes file://somerandomhost.ontheinternet.com/Users/xxxxx/Source/cpython/build/test_python_worker_4676æ/@test_4676_tmpæ, which is valid and expected.

Copy link
Copy Markdown
Contributor

@aisk NB: The review would go a lot faster if you were to add a short PR description of your changes

aisk commented May 6, 2025

Copy link
Copy Markdown
Member Author

@sharktide Thanks for noticing, updated!

sharktide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

aisk commented Jun 15, 2025

Copy link
Copy Markdown
Member Author

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.

sharktide left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think it’s good! Looking forward to see this being rolled out after a core review! ( I’m especially interested because I use windows too and am thinking of turning my old pc into a python server)

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

bedevere-app Bot commented Sep 3, 2025

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

aisk commented Sep 5, 2025

Copy link
Copy Markdown
Member Author

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.

Thanks for the view, updated!

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes OS-windows skip news stale Stale PR or inactive for long period of time. tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL