-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Running the "egg_info" command without proper rights results in a cryptic and unhelpful error message #3667
Comments
One possible way of fixing it would be to slightly amend the beginning of def run(self):
self.mkpath(self.egg_info)
try:
os.utime(self.egg_info, None)
except OSError as e:
raise distutils.errors.DistutilsFileError(f"{self.egg_info}: {e}") I am happy to help fixing this issue via something alike the above, if the maintainers agree that the solution is acceptable. |
Hi @droodev, thank you very much for reporting this. The proposed solution sounds interesting and simple. Would you like to provide a PR? (Personally I would keep the traceback with |
Hi @abravalheri, I will provide a PR soon. Thanks for the feedback! |
…e that was subject to the utime call; originally, the exception from utime does not point to this filepath. Ref pypa#3667.
The PR is here ;) |
setuptools version
setuptools == 65.5.1
Python version
Python 3.8, 3.9
OS
Ubuntu Mate
Additional environment information
I used setuptools via pip. However, the issue is not dependent on how exactly one runs the egg_info command.
Description
Develoiping a package, I tried to install it using pip with pyproject.toml specifying setuptools as a backend. After running
pip install -e .
I got an output with the following error:
running egg_info error: [Errno 13] Permission denied
The problem is that this error does not show to what the permission is denied.
I tracked it down, and the output comes from the
utime
function in this part (lines296-988) ofsetuptools/command/egg_info.py
(Click to see the file in the repo)
So
os.utime
raises anOSError
which is then printed out. Unfortunately, for some weird reason, the raised error does not contain a properly filled fieldfilename
, hence one needs a workaround to really print the file outExpected behavior
As usually with this kind of error, the expected output is something like:
error: [Errno 13] Permission denied: /foo/bar/package/src/package-egg.info
How to Reproduce
dist-err.zip
0. I assume that
pip
is installed.pyproject.toml
is)sudo mkdir src/dist_err_pkg.egg-info
(the quickest way of creating a directory inaccessible for a standard user in ubuntu)pip install .
Output
The text was updated successfully, but these errors were encountered: