File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -714,7 +714,6 @@ def check_file_attributes(self, result):
714714 self .assertTrue (isinstance (result .st_file_attributes , int ))
715715 self .assertTrue (0 <= result .st_file_attributes <= 0xFFFFFFFF )
716716
717- @unittest .expectedFailureIfWindows ('TODO: RUSTPYTHON; os.stat return value doesnt have st_file_attributes attribute' )
718717 @unittest .skipUnless (sys .platform == "win32" ,
719718 "st_file_attributes is Win32 specific" )
720719 def test_file_attributes (self ):
Original file line number Diff line number Diff line change @@ -223,7 +223,6 @@ def test_addsitedir_hidden_flags(self):
223223 finally :
224224 pth_file .cleanup ()
225225
226- @unittest .expectedFailure # TODO: RUSTPYTHON
227226 @unittest .skipUnless (sys .platform == 'win32' , 'test needs Windows' )
228227 @support .requires_subprocess ()
229228 def test_addsitedir_hidden_file_attribute (self ):
Original file line number Diff line number Diff line change @@ -801,6 +801,9 @@ pub(super) mod _os {
801801 #[ pyarg( any, default ) ]
802802 #[ pystruct_sequence( skip) ]
803803 pub st_reparse_tag : u32 ,
804+ #[ pyarg( any, default ) ]
805+ #[ pystruct_sequence( skip) ]
806+ pub st_file_attributes : u32 ,
804807 }
805808
806809 impl StatResultData {
@@ -835,6 +838,11 @@ pub(super) mod _os {
835838 #[ cfg( not( windows) ) ]
836839 let st_reparse_tag = 0 ;
837840
841+ #[ cfg( windows) ]
842+ let st_file_attributes = stat. st_file_attributes ;
843+ #[ cfg( not( windows) ) ]
844+ let st_file_attributes = 0 ;
845+
838846 Self {
839847 st_mode : vm. ctx . new_pyref ( stat. st_mode ) ,
840848 st_ino : vm. ctx . new_pyref ( stat. st_ino ) ,
@@ -853,6 +861,7 @@ pub(super) mod _os {
853861 st_mtime_ns : to_ns ( mtime) ,
854862 st_ctime_ns : to_ns ( ctime) ,
855863 st_reparse_tag,
864+ st_file_attributes,
856865 }
857866 }
858867 }
You can’t perform that action at this time.
0 commit comments