diff --git a/Lib/test/test_unittest/test_program.py b/Lib/test/test_unittest/test_program.py index 26808dc00..8ed92373e 100644 --- a/Lib/test/test_unittest/test_program.py +++ b/Lib/test/test_unittest/test_program.py @@ -505,7 +505,6 @@ class TestCommandLineArgs(unittest.TestCase): self.assertEqual(program.testNamePatterns, ['*foo*', '*bar*', '*pat*']) - @unittest.expectedFailureIf(sys.platform != "win32", "TODO: RUSTPYTHON") def testSelectedTestNamesFunctionalTest(self): def run_unittest(args): # Use -E to ignore PYTHONSAFEPATH env var diff --git a/src/interpreter.rs b/src/interpreter.rs index 230192d1e..89e24c25b 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -57,7 +57,23 @@ fn setup_dynamic_stdlib(vm: &mut crate::VirtualMachine) { use rustpython_vm::common::rc::PyRc; let state = PyRc::get_mut(&mut vm.state).unwrap(); - let paths = collect_stdlib_paths(); + let paths: Vec = collect_stdlib_paths() + .into_iter() + .map(|p| { + std::fs::canonicalize(&p) + .map(|canonical| { + let s = canonical.to_string_lossy(); + #[cfg(windows)] + { + if let Some(stripped) = s.strip_prefix(r"\\?\") { + return stripped.to_owned(); + } + } + s.into_owned() + }) + .unwrap_or(p) + }) + .collect(); // Set stdlib_dir to the first stdlib path if available if let Some(first_path) = paths.first() {