Repository: RustPython/RustPython (language: rust)

Issue:
`RUSTPYTHONPATH` doesn't automatically set on Windows
## Summary

<!-- Short description of the request. Please use incompatibility form to report missing features as Python interpreter -->

## Expected use case

<!-- By sharing detailed use case, we can understand the requirements better! If it will be used by open source projects, please also share the project URL. -->



Discussion / hints:
import os  

This is what we need. 


What is your platform?
Windows 11
Looked like RUSTPYTHONPATH not added automatically. 
Yes, we currently have that problem on Windows.
@ANVLISTENER I recently fixed RUSTPYTHONPATH problem on Windows. Could you please test if it works?

Fix patch:
diff --git a/pylib/build.rs b/pylib/build.rs
index 1aca8b3318..a541bc56d5 100644
--- a/pylib/build.rs
+++ b/pylib/build.rs
@@ -12,7 +12,12 @@ fn main() {
 
     if cfg!(windows) {
         if let Ok(real_path) = std::fs::read_to_string("Lib") {
-            println!("cargo:rustc-env=win_lib_path={real_path:?}");
+            let canonicalized_path = std::fs::canonicalize(real_path)
+                .expect("failed to resolve RUSTPYTHONPATH during build time");
+            println!(
+                "cargo:rustc-env=win_lib_path={}",
+                canonicalized_path.to_str().unwrap()
+            );
         }
     }
 }


Test patch: