File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1812,7 +1812,7 @@ def test_write_with_source_date_epoch(self):
18121812
18131813            with  zipfile .ZipFile (TESTFN , "r" ) as  zf :
18141814                zip_info  =  zf .getinfo ("test_source_date_epoch.txt" )
1815-                 get_time  =  time .localtime (int (os .environ ['SOURCE_DATE_EPOCH' ]))[:6 ]
1815+                 get_time  =  time .gmtime (int (os .environ ['SOURCE_DATE_EPOCH' ]))[:6 ]
18161816                # Compare each element of the date_time tuple 
18171817                # Allow for a 1-second difference 
18181818                for  z_time , g_time  in  zip (zip_info .date_time , get_time ):
Original file line number Diff line number Diff line change @@ -623,9 +623,12 @@ def _for_archive(self, archive):
623623        Return self. 
624624        """ 
625625        # gh-91279: Set the SOURCE_DATE_EPOCH to a specific timestamp 
626-         epoch  =  os .environ .get ('SOURCE_DATE_EPOCH' )
627-         get_time  =  int (epoch ) if  epoch  else  time .time ()
628-         self .date_time  =  time .localtime (get_time )[:6 ]
626+         source_date_epoch  =  os .environ .get ('SOURCE_DATE_EPOCH' )
627+ 
628+         if  source_date_epoch :
629+             self .date_time  =  time .gmtime (int (source_date_epoch ))[:6 ]
630+         else :
631+             self .date_time  =  time .localtime (time .time ())[:6 ]
629632
630633        self .compress_type  =  archive .compression 
631634        self .compress_level  =  archive .compresslevel 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments