You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have multiple users on a machine that each use requests from zipapps with certifi, one user running a request should not block other users from successfully performing requests. This issue only appears when using a zipapp on python3.6. For python3.7+ the certifi library handles the tempfile and requests.util.extract_zipped_paths never sees the zipapp. https://github.com/certifi/python-certifi/blob/2021.10.08/certifi/core.py#L43-L44
Expected Result
user1 # python3.6 zipapp.2.26.zip
get file
user2 # python3.6 zipapp.2.26.zip
get file
Actual Result
user1 # python3.6 zipapp.2.26.zip
get file
user2 # python3.6 zipapp.2.26.zip
Traceback (most recent call last):
File "/tmp/zipapp.2.26.zip/urllib3/util/ssl_.py", line 402, in ssl_wrap_socket
PermissionError: [Errno 13] Permission denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/zipapp.2.26.zip/urllib3/connectionpool.py", line 706, in urlopen
File "/tmp/zipapp.2.26.zip/urllib3/connectionpool.py", line 382, in _make_request
File "/tmp/zipapp.2.26.zip/urllib3/connectionpool.py", line 1010, in _validate_conn
File "/tmp/zipapp.2.26.zip/urllib3/connection.py", line 421, in connect
File "/tmp/zipapp.2.26.zip/urllib3/util/ssl_.py", line 404, in ssl_wrap_socket
urllib3.exceptions.SSLError: [Errno 13] Permission denied
During the handling the above ....... <a bunch of MaxRetryError tracebacks>
Behaviors on versions:
The core issue is that the changes in #5707 result in different file permissions on disk. Prior to that change, the file would be extracted with 0o664 permissions, but afterwords it is generated with 0o600 permissions from mkstemp, which means that users other than the first runner couldn't access the certfille.
Ideally I'd prefer the extract_zipped_paths writer use a temporary file like certifi which gets cleaned up at the end of the program, but as a fallback the writer could be updated to save with 0o664 permissions again so that it doesn't matter which user first runs.
The text was updated successfully, but these errors were encountered:
Adding read permissions (0o644) seems like a possibility, I'm not sure we want to return group write perms. Given 3.6 reaches end of life in ~10 days (2021-12-23), I'm not certain it's worth the effort though. It's likely we'll see support for Python 3.6 drop early next year which may be before we push out a release that has the code fix for this.
Given tomorrow's release will be the last to support Python 3.6 and we don't have any candidate solutions, I'm going to resolve this as won't fix. The support floor for the next non-hotfix release after 2.27.0 will have Python 3.7 as the floor for Python version support.
When you have multiple users on a machine that each use
requests
from zipapps withcertifi
, one user running a request should not block other users from successfully performing requests. This issue only appears when using a zipapp on python3.6. For python3.7+ the certifi library handles the tempfile andrequests.util.extract_zipped_paths
never sees the zipapp. https://github.com/certifi/python-certifi/blob/2021.10.08/certifi/core.py#L43-L44Expected Result
Actual Result
Behaviors on versions:
The core issue is that the changes in #5707 result in different file permissions on disk. Prior to that change, the file would be extracted with
0o664
permissions, but afterwords it is generated with0o600
permissions from mkstemp, which means that users other than the first runner couldn't access the certfille.requests/requests/utils.py
Lines 275 to 276 in c193d97
requests/requests/utils.py
Lines 283 to 288 in c193d97
Python3.6 w/ requests==2.25.1
Python3.6 w/ requests==2.26.0
Python3.7 w/ requests==2.26.0
System Information
Ideally I'd prefer the
extract_zipped_paths
writer use a temporary file likecertifi
which gets cleaned up at the end of the program, but as a fallback the writer could be updated to save with0o664
permissions again so that it doesn't matter which user first runs.The text was updated successfully, but these errors were encountered: