-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Windows: test_os.test_stat_inaccessible_file() fails if run as an administrator #114435
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I could only repro this due to CreateJunction changing the privilege level of the process, which should be fixed now. Do you know if you're doing anything similar, or whether your admin user has been configured with extra privileges? If not, we should bring back the test skip I tried in 6d0eac5 but use an explicit CreateFile call passing the backup semantics flag. That way at least we skip without failing. |
See my comment on #114273 (comment) |
I can still reproduce the issue on the current main branch at commit 5a1ecc8.
I didn't create "C:\System Volume Information", I didn't touch permissions of this directory. I don't know how to check privileges of my user. On SSH, I get:
I recently added
Sorry, it's unrelated. |
Okay, I'll bring back the test skip once I'm done with the other test fixes I'm working on. |
Also makes _winapi.CreateFile unconditionally use Unicode.
This test failed on my local machine even with a normal user:
I tried to create a new file
(The output means it processed 1 file successfully and 0 file failed.) The file can't be opened in Python or
The only non trivial thing is that this is a Insider Preview Windows 11 with release version 26020.1000. |
I'll check, it may be due to the new API we used when it's available. If so, this test will just have to check for matching dev/ino or zero, and we won't be able to tell whether it's actually testing the right code path. But when the new API is present, we don't ever go into the old code path, so eventually it becomes irrelevant. |
…ev (GH-114571) This may occur if Windows allows reading stat information from a file even if the current user does not have access.
The test shouldn't fail anymore, provided we get one of the two possible valid values. It still tests that all the stat values are sensible in the case of file-specific ACLs, though it doesn't actually guarantee that we used the correct code path anymore. |
… ino/dev (pythonGH-114571) This may occur if Windows allows reading stat information from a file even if the current user does not have access.
… ino/dev (pythonGH-114571) This may occur if Windows allows reading stat information from a file even if the current user does not have access. (cherry picked from commit d91ddff) Co-authored-by: Steve Dower <steve.dower@python.org>
… ino/dev (pythonGH-114571) This may occur if Windows allows reading stat information from a file even if the current user does not have access.
Uh oh!
There was an error while loading. Please reload this page.
When test_os is run as an administrator, like running tests in a SSH shell for example, the test fails:
The test was added recently by commit ed06648 of issue gh-111877.
Linked PRs
The text was updated successfully, but these errors were encountered: