Handle failure to call dlopen(NULL)#294
Merged
brettcannon merged 2 commits intopypa:masterfrom May 23, 2020
Merged
Conversation
9fe988b to
20edd7b
Compare
brettcannon
requested changes
Apr 24, 2020
Member
brettcannon
left a comment
There was a problem hiding this comment.
Happy to take the fix, but we need a test to make sure we don't break this in the future.
See the inline comment for the explanation.
I have been running into this bug on PyOxidizer when using
Python distributions built against musl libc. For reference:
$ ldd python/install/bin/python3.7m
not a dynamic executable
$ python/install/bin/python3.7m
Python 3.7.7 (default, Apr 5 2020, 06:02:52)
[Clang 9.0.1 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> ctypes.CDLL(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gps/src/pyoxidizer.git/build/python_distributions/python.c1ffa330c730/python/install/lib/python3.7/ctypes/__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: Dynamic loading not supported
Interestingly, OSError is incomplete (possibly a CPython ctypes bug?):
>>> try:
... ctypes.CDLL(None)
... except OSError as e:
... err = e
...
>>> err
OSError('Dynamic loading not supported')
>>> err.errno
None
>>> err.strerror
None
>>> err.args
('Dynamic loading not supported',)
4a8aae4 to
c34020e
Compare
Contributor
Author
|
@brettcannon I believe this is ready for a re-review. |
pradyunsg
approved these changes
May 15, 2020
brettcannon
approved these changes
May 23, 2020
Closed
indygreg
added a commit
to astral-sh/python-build-standalone
that referenced
this pull request
Nov 17, 2021
setuptools finally upgraded the vendored packaging package, so we can remove the patch we contributed upstream in pypa/packaging#294. A similar patch for pip still lingers (perhaps we haven't tried to contribute that upstream yet).
indygreg
added a commit
to astral-sh/python-build-standalone
that referenced
this pull request
Nov 17, 2021
setuptools finally upgraded the vendored packaging package, so we can remove the patch we contributed upstream in pypa/packaging#294. A similar patch for pip still lingers (perhaps we haven't tried to contribute that upstream yet).
This was referenced May 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See the inline comment for the explanation.
I have been running into this bug on PyOxidizer when using
Python distributions built against musl libc. For reference:
Interestingly, OSError is incomplete (possibly a CPython ctypes bug?):