MCPcopy Index your code
hub / github.com/python/cpython / utime

Method utime

Lib/tarfile.py:2828–2839  ·  view source on GitHub ↗

Set modification time of targetpath according to tarinfo.

(self, tarinfo, targetpath)

Source from the content-addressed store, hash-verified

2826 raise ExtractError("could not change mode") from e
2827
2828 def utime(self, tarinfo, targetpath):
2829 """Set modification time of targetpath according to tarinfo.
2830 """
2831 mtime = tarinfo.mtime
2832 if mtime is None:
2833 return
2834 if not hasattr(os, 'utime'):
2835 return
2836 try:
2837 os.utime(targetpath, (mtime, mtime))
2838 except OSError as e:
2839 raise ExtractError("could not change modification time") from e
2840
2841 #--------------------------------------------------------------------------
2842 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 1

ExtractErrorClass · 0.85

Tested by 15

test_cleanMethod · 0.64
test_rereadMethod · 0.64
test_forceMethod · 0.64
testZip64LargeFileMethod · 0.64
_do_singleMethod · 0.64