Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-129333: fix import error over nfs on Windows#129616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ChrisDenton wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromChrisDenton:unc

Conversation

ChrisDenton
Copy link

@ChrisDentonChrisDenton commentedFeb 3, 2025
edited by bedevere-appbot
Loading

On Windows,getpath_realpath usesGetFinalPathNameByHandleW to resolve paths. This returns paths starting with a\\?\ prefix, which is usually not what we want.

This change attempts to remove the prefix for\\?\UNC\ paths. A similar thing was already done for drive paths such as\\?\C:\.

On Windows, realpath uses `GetFinalPathNameByHandleW` to resolve paths. This returns paths starting with a `\\?\` prefix, which is usually not what we want.This change attempts to remove the prefix for \\?\UNC\ paths. A similar thing was already done for drive paths such as \\?\C:\.
@ghost
Copy link

ghost commentedFeb 3, 2025
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@ChrisDentonChrisDenton changed the titlegh-12933: fix import error over nfs on Windowsgh-129333: fix import error over nfs on WindowsFeb 3, 2025
@ChrisDenton
Copy link
Author

The test failures in free-threading look unrelated to my eye but maybe I'm missing some context. E.g. I'm not sure how this change could cause cause a concurrency issue:

     self._send_bytes(m[offset:offset + size])    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\a\cpython\cpython\Lib\multiprocessing\connection.py", line 293, in _send_bytes    raise ValueError("concurrent send_bytes() calls "                     "are not supported")ValueError: concurrent send_bytes() calls are not supported

@FFY00
Copy link
Member

@eryksun, would you mind having a look at this one? Thanks!

@FFY00FFY00 requested a review fromeryksunFebruary 4, 2025 04:32
@FFY00
Copy link
Member

The test failures in free-threading look unrelated to my eye but maybe I'm missing some context.

I triggered a re-run, let's see if it reproduces.

ChrisDenton reacted with thumbs up emoji

@FFY00
Copy link
Member

@nineteendo could also use your input, if you have time to look at this. Cheers!

@nineteendo
Copy link
Contributor

Well, I can't test this on my machine because python crashes with these warnings after the build (his is not a new issue):

C:\Users\wanne\cpython\PCbuild\python.vcxproj(134,5): warning MSB3073: The command "setlocalC:\Users\wanne\cpython\PCbuild\python.vcxproj(134,5): warning MSB3073: set PYTHONPATH=C:\Users\wanne\cpython\LibC:\Users\wanne\cpython\PCbuild\python.vcxproj(134,5): warning MSB3073: "C:\Users\wanne\cpython\PCbuild\amd64\python.exe" "C:\Users\wanne\cpython\PC\validate_ucrtbase.py" ucrtbase" exited with code -1073741819 .

You still need to add tests though.

@ChrisDenton
Copy link
Author

You still need to add tests though.

I'm not sure how to add tests.realpath requires that the path really exist on a network path. We can't fake it because the point ofrealpath is to resolve to the real path.

@FFY00
Copy link
Member

Is there no other way to getGetFinalPathNameByHandleW to returnUNC paths?

@FFY00
Copy link
Member

Well, I can't test this on my machine because python crashes with these warnings after the build (his is not a new issue):

Is it fixed inmain? If so we can sync the PR, so that the fix is included.

@nineteendo
Copy link
Contributor

nineteendo commentedFeb 5, 2025
edited
Loading

No, this issue is still open:#123414

UPDATE: fixed by creating a clean clone, but I can't install Python libraries it seems

@ChrisDenton
Copy link
Author

Is there no other way to getGetFinalPathNameByHandleW to returnUNC paths?

Hmm... maybe I could try using a\\localhost\c$ path. I'll experiment.

@ChrisDenton
Copy link
Author

ChrisDenton commentedFeb 6, 2025
edited
Loading

That seems to work but the next problem I'm encountering is that there doesn't appear to be any existing unit tests for the C implementation ofrealpath (or any of the other functions ingetpath.c) and I don't know how to add them. Thetest_getpath.py shims them for its testing.

I could maybe test usingsysconfig::get_paths() but that means we'd need to run the test python using a\\?\UNC\localhost\ style path and not all drives support that (iirc dev drives don't). So it might be a bit flaky.

@ChrisDenton
Copy link
Author

This can be tested locally without needing to import anything by starting python with a\\?\UNC path. E.g. if the build directory is inC:\Users\Chris\Python\PCBuild\amd64\python.exe then run:

\\?\UNC\localhost\c$\Users\Chris\Python\PCBuild\amd64\python.exe -c"import sysconfig; print(sysconfig.get_paths()['include'])"

This should print the simplified path:\\localhost\c$\Users\Chris\Python\Include. Whereas before this change it will have the long\\?\UNC path.

However, this relies on the drive supporting\\locahost.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@FFY00FFY00Awaiting requested review from FFY00FFY00 is a code owner

@eryksuneryksunAwaiting requested review from eryksun

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ChrisDenton@FFY00@nineteendo

[8]ページ先頭

©2009-2025 Movatter.jp