[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

LP: #809951 (untagged extensions)



Hi Piotr,

Martin Pitt discovered this problem in dh_python3:

https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/809951

Even in a post-PEP 3149 world, Python 3.2 itself can import untagged .so files
(which preserves backward compatibility).  python3-gobject's build system does
not tag .so files even when it's built with Python 3.2.

I'm not entirely sure how to handle this, but I think this bit of code in
dh_python3 should not hardcode vers==31:

-----snip snip-----
def tagged_extname(fname, version, dbg_package=False):
    """Return tagged extension name for given file & version."""
    vers = vrepr(version)  # make sure it's a string
    vers = vers.replace('.', '')
    if vers == '3':
        # assume .so files without tag in /usr/lib/python3/ are build for Python 3.1
        vers = '31'
    if fname.endswith('_d.so'):
        fname = "%s.%s.so" % (fname[:-5], DBG_EXTENSION_TAG % vers)
    elif dbg_package:
        fname = "%s.%s.so" % (fname[:-3], DBG_EXTENSION_TAG % vers)
    else:
        fname = "%s.%s.so" % (fname[:-3], EXTENSION_TAG % vers)
    return fname
-----snip snip-----


Probably, it should query the version of Python being used, with something
like:

$ python3 -c "import sysconfig; print(sysconfig.get_config_var('SO'))"
.cpython-32mu.so

Thoughts?
-Barry

Attachment: signature.asc
Description: PGP signature


Reply to: