This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Alex Shpilkin, RedEyed, doko, eryksun, vstinner
Date 2021-02-16.13:35:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Issue 41976 added ctypes.util._is_elf() to filter out linker scripts such as "". The PR was backported to 3.7. _is_elf() assumes the trace result has absolute paths that can be opened, but Matthias is getting the relative filename "liblibc.a" in the result. Whatever the reason, I think if the file can't be opened for reading, then _is_elf() should just return False. For example:

    def _is_elf(filename):
        "Return True if the given file is an ELF file"
        elf_header = b'\x7fELF'
            with open(filename, 'br') as thefile:
                return == elf_header
        except OSError:
            return False
Date User Action Args
2021-02-16 13:35:22eryksunsetrecipients: + eryksun, doko, vstinner, Alex Shpilkin, RedEyed
2021-02-16 13:35:22eryksunsetmessageid: <>
2021-02-16 13:35:22eryksunlinkissue42580 messages
2021-02-16 13:35:22eryksuncreate