Skip to content

Commit fb3313f

Browse files
committed
Catching the exception of utime in order to provide a path to the file that was subject to the utime call; originally, the exception from utime does not point to this filepath. Ref #3667.
1 parent 6f7dd7c commit fb3313f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setuptools/command/egg_info.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ def delete_file(self, filename):
295295

296296
def run(self):
297297
self.mkpath(self.egg_info)
298-
os.utime(self.egg_info, None)
298+
try:
299+
os.utime(self.egg_info, None)
300+
except OSError as e:
301+
msg = f"Cannot update time stamp of directory '{self.egg_info}'"
302+
raise distutils.errors.DistutilsFileError(msg) from e
299303
for ep in metadata.entry_points(group='egg_info.writers'):
300304
writer = ep.load()
301305
writer(self, ep.name, os.path.join(self.egg_info, ep.name))

0 commit comments

Comments
 (0)