Skip to content

Commit 3438fb2

Browse files
authored
nt junction (#6407)
* pylib strip path * nt._path_* functions, * nt junction
1 parent d34b2cf commit 3438fb2

File tree

5 files changed

+470
-34
lines changed

5 files changed

+470
-34
lines changed

Lib/test/test_ntpath.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,6 @@ def test_nt_helpers(self):
13831383
self.assertIsInstance(b_final_path, bytes)
13841384
self.assertGreater(len(b_final_path), 0)
13851385

1386-
@unittest.expectedFailure # TODO: RUSTPYTHON
13871386
@unittest.skipIf(sys.platform != 'win32', "Can only test junctions with creation on win32.")
13881387
def test_isjunction(self):
13891388
with os_helper.temp_dir() as d:

Lib/test/test_os.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3130,7 +3130,6 @@ def tearDown(self):
31303130
if os.path.lexists(self.junction):
31313131
os.unlink(self.junction)
31323132

3133-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; (AttributeError: module '_winapi' has no attribute 'CreateJunction')")
31343133
def test_create_junction(self):
31353134
_winapi.CreateJunction(self.junction_target, self.junction)
31363135
self.assertTrue(os.path.lexists(self.junction))

crates/pylib/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ fn main() {
1616
{
1717
let canonicalized_path = std::fs::canonicalize(real_path)
1818
.expect("failed to resolve RUSTPYTHONPATH during build time");
19-
println!(
20-
"cargo:rustc-env=win_lib_path={}",
21-
canonicalized_path.to_str().unwrap()
22-
);
19+
// Strip the extended path prefix (\\?\) that canonicalize adds on Windows
20+
let path_str = canonicalized_path.to_str().unwrap();
21+
let path_str = path_str.strip_prefix(r"\\?\").unwrap_or(path_str);
22+
println!("cargo:rustc-env=win_lib_path={path_str}");
2323
}
2424
}
2525

crates/vm/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ features = [
124124
"Win32_System_Console",
125125
"Win32_System_Diagnostics_Debug",
126126
"Win32_System_Environment",
127+
"Win32_System_IO",
127128
"Win32_System_Ioctl",
129+
"Win32_System_Kernel",
128130
"Win32_System_LibraryLoader",
129131
"Win32_System_Memory",
130132
"Win32_System_Performance",

0 commit comments

Comments
 (0)