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 florinspatar
Recipients florinspatar, mattip, miss-islington, pablogsal, vstinner
Date 2021-08-20.09:34:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org>
In-reply-to
Content
On HP-UX, python can no longer find extension modules with the '.sl' suffix.

[fspatar@hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> ~/tmp/investigation3/old/bin/python3
Python 3.8.11 (default, Aug  3 2021, 06:15:31) 
[GCC 4.2.4] on hp-ux-pa
Type "help", "copyright", "credits" or "license" for more information.
>>> import M2Crypto
Traceback (most recent call last):
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2crypto.py", line 16, in swig_import_helper
    fp, pathname, description = imp.find_module('_m2crypto', [dirname(__file__)])
  File "/h/fspatar/tmp/investigation3/old/lib/python3.8/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_m2crypto'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/__init__.py", line 37, in <module>
    from M2Crypto import (ASN1, AuthCookie, BIO, BN, DH, DSA, EVP, Engine, Err,
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/ASN1.py", line 15, in <module>
    from M2Crypto import BIO, m2, py27plus, six, has_typing
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/BIO.py", line 9, in <module>
    from M2Crypto import m2, py27plus, six, has_typing
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2.py", line 30, in <module>
    from M2Crypto.m2crypto import *
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2crypto.py", line 26, in <module>
    _m2crypto = swig_import_helper()
  File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2crypto.py", line 18, in swig_import_helper
    import _m2crypto
ModuleNotFoundError: No module named '_m2crypto'

This works fine in python 3.8.5

[fspatar@hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> /opt/OPSWbuildtools/2.0.5/python/3.8.5.04/bin/python3
Python 3.8.5 (default, Jul 28 2021, 08:38:55) 
[GCC 4.2.4] on hp-ux-pa
Type "help", "copyright", "credits" or "license" for more information.
>>> import M2Crypto

It seems to be related to recent changes from https://bugs.python.org/issue42604

Given the file name is _m2crypto.sl, python 3.8.11 can no longer find it. Based on https://www.python.org/dev/peps/pep-3149/#pep-384, my understanding is that python should search for the following file names when extension module _m2crypto is imported (in this order):

_m2crypto.cpython-38.sl
_m2crypto.so

Python can only load the extension module if the file name is _m2crypto.cpython-38.sl

[fspatar@hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> ~/tmp/investigation3/old/bin/python3
Python 3.8.11 (default, Aug  3 2021, 06:15:31) 
[GCC 4.2.4] on hp-ux-pa
Type "help", "copyright", "credits" or "license" for more information.
>>> import _imp
>>> _imp.extension_suffixes()
['.cpython-38.sl']
>>> 

[fspatar@hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> /opt/OPSWbuildtools/2.0.5/python/3.8.5.04/bin/python3
Python 3.8.5 (default, Jul 28 2021, 08:38:55) 
[GCC 4.2.4] on hp-ux-pa
Type "help", "copyright", "credits" or "license" for more information.
>>> import _imp
>>> _imp.extension_suffixes()
['.sl']
>>>
History
Date User Action Args
2021-08-20 09:34:43florinspatarsetrecipients: + florinspatar, vstinner, mattip, pablogsal, miss-islington
2021-08-20 09:34:42florinspatarsetmessageid: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org>
2021-08-20 09:34:42florinspatarlinkissue44959 messages
2021-08-20 09:34:42florinspatarcreate