summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Kaczmarczyk <andrzej.kaczmarczyk@agh.edu.pl>2022-11-26 13:57:38 +0100
committerAndrzej Kaczmarczyk <andrzej.kaczmarczyk@agh.edu.pl>2022-11-28 23:05:51 +0100
commitfb3313fe7fb650c822e9ec89660915b37b7d891e (patch)
treeb926edf8399fd3a0528f4a80828fdef074735346
parent6f7dd7c12ceffa2aefe28c2fbafbad2273980b2b (diff)
downloadpython-setuptools-git-fb3313fe7fb650c822e9ec89660915b37b7d891e.tar.gz
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.
-rw-r--r--setuptools/command/egg_info.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 25888ed8..95c81845 100644
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -295,7 +295,11 @@ class egg_info(InfoCommon, Command):
def run(self):
self.mkpath(self.egg_info)
- os.utime(self.egg_info, None)
+ try:
+ os.utime(self.egg_info, None)
+ except OSError as e:
+ msg = f"Cannot update time stamp of directory '{self.egg_info}'"
+ raise distutils.errors.DistutilsFileError(msg) from e
for ep in metadata.entry_points(group='egg_info.writers'):
writer = ep.load()
writer(self, ep.name, os.path.join(self.egg_info, ep.name))