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

Commit28463db

Browse files
authored
[3.12]gh-135034: Remove test_realpath_permission (GH-135093)
The test was added ingh-110298, with a fix that was never backportedto 3.12 and below.It was most likely skipped in the GHA run.
1 parentfcf3ea0 commit28463db

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

‎Lib/test/test_ntpath.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -836,51 +836,6 @@ def test_realpath_cwd(self):
836836
test_file_long,
837837
ntpath.realpath("file.txt",**kwargs))
838838

839-
@unittest.skipUnless(HAVE_GETFINALPATHNAME,'need _getfinalpathname')
840-
deftest_realpath_permission(self):
841-
# Test whether python can resolve the real filename of a
842-
# shortened file name even if it does not have permission to access it.
843-
ABSTFN=ntpath.realpath(os_helper.TESTFN)
844-
845-
os_helper.unlink(ABSTFN)
846-
os_helper.rmtree(ABSTFN)
847-
os.mkdir(ABSTFN)
848-
self.addCleanup(os_helper.rmtree,ABSTFN)
849-
850-
test_file=ntpath.join(ABSTFN,"LongFileName123.txt")
851-
test_file_short=ntpath.join(ABSTFN,"LONGFI~1.TXT")
852-
853-
withopen(test_file,"wb")asf:
854-
f.write(b"content")
855-
# Automatic generation of short names may be disabled on
856-
# NTFS volumes for the sake of performance.
857-
# They're not supported at all on ReFS and exFAT.
858-
p=subprocess.run(
859-
# Try to set the short name manually.
860-
['fsutil.exe','file','setShortName',test_file,'LONGFI~1.TXT'],
861-
creationflags=subprocess.DETACHED_PROCESS
862-
)
863-
864-
ifp.returncode:
865-
raiseunittest.SkipTest('failed to set short name')
866-
867-
try:
868-
self.assertPathEqual(test_file,ntpath.realpath(test_file_short))
869-
exceptAssertionError:
870-
raiseunittest.SkipTest('the filesystem seems to lack support for short filenames')
871-
872-
# Deny the right to [S]YNCHRONIZE on the file to
873-
# force nt._getfinalpathname to fail with ERROR_ACCESS_DENIED.
874-
p=subprocess.run(
875-
['icacls.exe',test_file,'/deny','*S-1-5-32-545:(S)'],
876-
creationflags=subprocess.DETACHED_PROCESS
877-
)
878-
879-
ifp.returncode:
880-
raiseunittest.SkipTest('failed to deny access to the test file')
881-
882-
self.assertPathEqual(test_file,ntpath.realpath(test_file_short))
883-
884839
deftest_expandvars(self):
885840
withos_helper.EnvironmentVarGuard()asenv:
886841
env.clear()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp