@@ -17,7 +17,7 @@ pub(crate) mod module {
1717 function:: Either ,
1818 function:: OptionalArg ,
1919 stdlib:: os:: {
20- errno_err, DirFd , FollowSymlinks , PyPathLike , SupportFunc , TargetIsDirectory , _os,
20+ errno_err, DirFd , FollowSymlinks , OsPath , SupportFunc , TargetIsDirectory , _os,
2121 } ,
2222 PyResult , TryFromObject , VirtualMachine ,
2323 } ;
@@ -35,7 +35,7 @@ pub(crate) mod module {
3535 use libc:: { O_BINARY , O_TEMPORARY } ;
3636
3737 #[ pyfunction]
38- pub ( super ) fn access ( path : PyPathLike , mode : u8 , vm : & VirtualMachine ) -> PyResult < bool > {
38+ pub ( super ) fn access ( path : OsPath , mode : u8 , vm : & VirtualMachine ) -> PyResult < bool > {
3939 use um:: { fileapi, winnt} ;
4040 let attr = unsafe { fileapi:: GetFileAttributesW ( path. to_widecstring ( vm) ?. as_ptr ( ) ) } ;
4141 Ok ( attr != fileapi:: INVALID_FILE_ATTRIBUTES
@@ -46,8 +46,8 @@ pub(crate) mod module {
4646
4747 #[ derive( FromArgs ) ]
4848 pub ( super ) struct SymlinkArgs {
49- src : PyPathLike ,
50- dst : PyPathLike ,
49+ src : OsPath ,
50+ dst : OsPath ,
5151 #[ pyarg( flatten) ]
5252 target_is_directory : TargetIsDirectory ,
5353 #[ pyarg( flatten) ]
@@ -90,7 +90,7 @@ pub(crate) mod module {
9090
9191 #[ pyfunction]
9292 fn chmod (
93- path : PyPathLike ,
93+ path : OsPath ,
9494 dir_fd : DirFd < 0 > ,
9595 mode : u32 ,
9696 follow_symlinks : FollowSymlinks ,
@@ -239,7 +239,7 @@ pub(crate) mod module {
239239 }
240240
241241 #[ pyfunction]
242- fn _getfinalpathname ( path : PyPathLike , vm : & VirtualMachine ) -> PyResult {
242+ fn _getfinalpathname ( path : OsPath , vm : & VirtualMachine ) -> PyResult {
243243 let real = path
244244 . as_ref ( )
245245 . canonicalize ( )
@@ -248,7 +248,7 @@ pub(crate) mod module {
248248 }
249249
250250 #[ pyfunction]
251- fn _getfullpathname ( path : PyPathLike , vm : & VirtualMachine ) -> PyResult {
251+ fn _getfullpathname ( path : OsPath , vm : & VirtualMachine ) -> PyResult {
252252 let wpath = path. to_widecstring ( vm) ?;
253253 let mut buffer = vec ! [ 0u16 ; winapi:: shared:: minwindef:: MAX_PATH ] ;
254254 let ret = unsafe {
@@ -281,7 +281,7 @@ pub(crate) mod module {
281281 }
282282
283283 #[ pyfunction]
284- fn _getvolumepathname ( path : PyPathLike , vm : & VirtualMachine ) -> PyResult {
284+ fn _getvolumepathname ( path : OsPath , vm : & VirtualMachine ) -> PyResult {
285285 let wide = path. to_widecstring ( vm) ?;
286286 let buflen = std:: cmp:: max ( wide. len ( ) , winapi:: shared:: minwindef:: MAX_PATH ) ;
287287 let mut buffer = vec ! [ 0u16 ; buflen] ;
@@ -296,7 +296,7 @@ pub(crate) mod module {
296296 }
297297
298298 #[ pyfunction]
299- fn _path_splitroot ( path : PyPathLike , vm : & VirtualMachine ) -> PyResult < ( String , String ) > {
299+ fn _path_splitroot ( path : OsPath , vm : & VirtualMachine ) -> PyResult < ( String , String ) > {
300300 let orig: Vec < _ > = path. path . into_os_string ( ) . encode_wide ( ) . collect ( ) ;
301301 if orig. is_empty ( ) {
302302 return Ok ( ( "" . to_owned ( ) , "" . to_owned ( ) ) ) ;
@@ -334,7 +334,7 @@ pub(crate) mod module {
334334 }
335335
336336 #[ pyfunction]
337- fn _getdiskusage ( path : PyPathLike , vm : & VirtualMachine ) -> PyResult < ( u64 , u64 ) > {
337+ fn _getdiskusage ( path : OsPath , vm : & VirtualMachine ) -> PyResult < ( u64 , u64 ) > {
338338 use um:: fileapi:: GetDiskFreeSpaceExW ;
339339 use winapi:: shared:: { ntdef:: ULARGE_INTEGER , winerror} ;
340340
@@ -399,7 +399,7 @@ pub(crate) mod module {
399399
400400 #[ pyfunction]
401401 fn mkdir (
402- path : PyPathLike ,
402+ path : OsPath ,
403403 mode : OptionalArg < i32 > ,
404404 dir_fd : DirFd < { _os:: MKDIR_DIR_FD as usize } > ,
405405 vm : & VirtualMachine ,
0 commit comments