MCPcopy Index your code
hub / github.com/RustPython/RustPython / utime

Method utime

Lib/tarfile.py:2803–2814  ·  view source on GitHub ↗

Set modification time of targetpath according to tarinfo.

(self, tarinfo, targetpath)

Source from the content-addressed store, hash-verified

2801 raise ExtractError("could not change mode") from e
2802
2803 def utime(self, tarinfo, targetpath):
2804 """Set modification time of targetpath according to tarinfo.
2805 """
2806 mtime = tarinfo.mtime
2807 if mtime is None:
2808 return
2809 if not hasattr(os, 'utime'):
2810 return
2811 try:
2812 os.utime(targetpath, (mtime, mtime))
2813 except OSError as e:
2814 raise ExtractError("could not change modification time") from e
2815
2816 #--------------------------------------------------------------------------
2817 def next(self):

Callers 15

extractallMethod · 0.95
_extract_memberMethod · 0.95
addMethod · 0.80
__setitem__Method · 0.80
copy_infoFunction · 0.80
touchMethod · 0.80
test_cleanMethod · 0.80
test_rereadMethod · 0.80

Calls 2

hasattrFunction · 0.85
ExtractErrorClass · 0.85

Tested by 15

test_cleanMethod · 0.64
test_rereadMethod · 0.64
test_forceMethod · 0.64
testZip64LargeFileMethod · 0.64
set_timeMethod · 0.64
test_large_timeMethod · 0.64