[pypy-commit] pypy py3.5: Remove platform.machine() from the extension of the CPython- and CFFI-compatible dynamic libraries. I cannot figure out why it was added in the first place, and it seems wrong (we might get AMD64 on a 32-bit python). It also causes a bug in importlib that was quite some efforts to track.

arigo pypy.commits at gmail.com
Mon Dec 18 10:02:41 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r93475:d79aaf54b0bc
Date: 2017-12-18 15:37 +0100
http://bitbucket.org/pypy/pypy/changeset/d79aaf54b0bc/

Log:	Remove platform.machine() from the extension of the CPython- and
	CFFI-compatible dynamic libraries. I cannot figure out why it was
	added in the first place, and it seems wrong (we might get AMD64 on
	a 32-bit python). It also causes a bug in importlib that was quite
	some efforts to track.

diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -47,14 +47,19 @@
     if platform_name == 'linux2':
         platform_name = 'linux'
 
-    soabi += '-' + platform.machine() + '-' + platform_name
+    soabi += '-' + platform_name
+    # xxx used to also include platform.machine(), but this is wrong
+    # (might get AMD64 on a 32-bit python) and it is the source of a
+    # importlib bug if we get uppercase characters from there...
 
     if platform_name == 'linux':
         soabi += '-gnu'
         if sys.maxsize == (2**31 - 1) and platform.machine() == 'x86_64':
             soabi += 'x32'
 
-    return '.' + soabi + SO
+    result = '.' + soabi + SO
+    assert result == result.lower()   # this is an implicit requirement of importlib on Windows!
+    return result
 
 def has_so_extension(space):
     return (space.config.objspace.usemodules.cpyext or


More information about the pypy-commit mailing list