From eca75b36113eb5de2b30ccef74ce0084366d350e Mon Sep 17 00:00:00 2001 From: rmliddle Date: Tue, 5 Feb 2019 22:18:24 +1100 Subject: [PATCH] Comment and formatted on windows rust_file call --- vm/src/stdlib/os.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vm/src/stdlib/os.rs b/vm/src/stdlib/os.rs index 41d9a84c6..499ae197b 100644 --- a/vm/src/stdlib/os.rs +++ b/vm/src/stdlib/os.rs @@ -38,10 +38,14 @@ pub fn raw_file_number(handle: File) -> i32 { #[cfg(target_family = "windows")] pub fn rust_file(raw_fileno: i32) -> File { + use std::ffi::c_void; use std::os::windows::io::FromRawHandle; - use std::ffi::c_void; - unsafe { File::from_raw_handle(raw_fileno as *mut c_void)} + //TODO: This is untested and (very) unsafe handling or + //raw pointers - This should be patched as a matter of + //urgently patched by comparison to the cpython handling of + //the equivalent fileno fields for windows + unsafe { File::from_raw_handle(raw_fileno as *mut c_void) } } pub fn os_close(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {