Skip to content
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

Rootless docker images get permission denied #181

Closed
smivv opened this issue Oct 30, 2024 · 2 comments · Fixed by #182
Closed

Rootless docker images get permission denied #181

smivv opened this issue Oct 30, 2024 · 2 comments · Fixed by #182

Comments

@smivv
Copy link

smivv commented Oct 30, 2024

Hi,

I am having an issue with the code in your library:

/usr/local/lib/python3.11/dist-packages/starlette/formparsers.py:10: in <module>
    import multipart
/usr/local/lib/python3.11/dist-packages/multipart/__init__.py:10: in <module>
    if file_path.is_file():
/usr/lib/python3.11/pathlib.py:1267: in is_file
    return S_ISREG(self.stat().st_mode)
/usr/lib/python3.11/pathlib.py:1013: in stat
    return os.stat(self, follow_symlinks=follow_symlinks)
E   PermissionError: [Errno 13] Permission denied: '/root/multipart.py'

Please add handling of this issue!

defnull added a commit to defnull/python-multipart that referenced this issue Oct 30, 2024
Path.is_file() throws PermissionError if the current user is not allowed to list one of the parent directories. An import would also fail, so threat this as if the file wasn't there.

fixes Kludex#181
defnull added a commit to defnull/python-multipart that referenced this issue Oct 30, 2024
Path.is_file() throws PermissionError if the current user is not allowed to list one of the parent directories. An import would also fail, so treat this as if the file wasn't there.

fixes Kludex#181
@defnull
Copy link
Contributor

defnull commented Oct 30, 2024

If you do not want to wait for the PR to be merged, you could also update Starlette to the most recent release or pin python-multipart to version 0.0.12. The fallback code that fails here should only be invoked if you use a recent version of python-multipart together with an old version of Starlette or FastAPI.

@smivv
Copy link
Author

smivv commented Oct 30, 2024

Thanks, already did that. I will remove that once your fix is ready and released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants