File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
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 @@ -778,6 +778,9 @@ pub(super) mod _os {
778778 #[ pyarg( any, default ) ]
779779 #[ pystruct_sequence( skip) ]
780780 pub st_reparse_tag : u32 ,
781+ #[ pyarg( any, default ) ]
782+ #[ pystruct_sequence( skip) ]
783+ pub st_file_attributes : u32 ,
781784 }
782785
783786 impl StatResultData {
@@ -812,6 +815,11 @@ pub(super) mod _os {
812815 #[ cfg( not( windows) ) ]
813816 let st_reparse_tag = 0 ;
814817
818+ #[ cfg( windows) ]
819+ let st_file_attributes = stat. st_file_attributes ;
820+ #[ cfg( not( windows) ) ]
821+ let st_file_attributes = 0 ;
822+
815823 Self {
816824 st_mode : vm. ctx . new_pyref ( stat. st_mode ) ,
817825 st_ino : vm. ctx . new_pyref ( stat. st_ino ) ,
@@ -830,6 +838,7 @@ pub(super) mod _os {
830838 st_mtime_ns : to_ns ( mtime) ,
831839 st_ctime_ns : to_ns ( ctime) ,
832840 st_reparse_tag,
841+ st_file_attributes,
833842 }
834843 }
835844 }
You can’t perform that action at this time.
0 commit comments