bpo-35348: Fix platform.architecture() - #11159
Conversation
|
@serhiy-storchaka: you wrote PR #11160, but I'm confident that it will be fine to use "file -b -- executable" command. I propose to make this change in the master branch and leave stable branches (2.7 and 3.7) unchanged. If something goes wrong, we can easily revert this change. |
|
Could you then borrow other changes from #11160? |
Make platform.architecture() parsing of "file" command output more reliable: * Add the "-b" option to the "file" command to omit the filename; * Force the usage of the C locale; * Search also the "shared object" pattern. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
|
I removed "--" from "file -b -- target". If target starts with "-", file will fail since the filename miss. Example: This change should prevent portability issue.
Sure. I picked your changes into my PR and I credited you. I replaced env={'LC_ALL': 'C'} with env=dict(os.environ, LC_ALL='C'). Few programs like to run in an (almost) empty environment. I wasn't sure if you preferred to push your changes separately or not. |

Fix platform.architecture(): add the -b option to the "file" command.
https://bugs.python.org/issue35348