Ned Deily <n...@python.org> added the comment:

> the "reliable way to run under rosetta" is using "arch -x86_64 python3". I 
> don't particularly like having another executable to accomplish the same goal.

Unfortunately, using "arch" is *not* a reliable way in general. It works fine 
for the initial invocation of the interpreter but things fall apart when a 
Python program tries to invoke another Python interpreter in a subprocess. The 
standard idiom for finding the location of the running interpreter is to use 
the contents of sys.executable. But that merely contains the name of the 
interpreter file, thus the additional "arch" arguments are lost and the 
interpreter will launch in the subprocess using the default arch, which may 
result in a failure (if you are lucky) or, worse, will silently run under the 
wrong architecture potentially giving misleading results. The most notable 
example of this is while running the python test suite. We ran into this same 
issue years ago with the "intel" universal-arch build option which is why we 
added a "python3-32" executable to provide a reliable way to force 32-bit 
execution on a 64-bit-capable Mac. The need for "python3-intel64" will 
eventually go a
 way once Rosetta2 is no longer supported.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44933>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to