bpo-35344: platform.platform() uses mac_ver() on macOS by vstinner · Pull Request #10780 · python/cpython (original) (raw)

@malemburg, @ned-deily, @ronaldoussoren: So, what do you think of:

$ python3.8 -m platform
macOS-10.13.6-x86_64-i386-64bit

instead of:

$ python3.8 -m platform
Darwin-17.7.0-x86_64-i386-64bit

?

I like this, information about macOS is more interesting than information about the kernel version.

I'm not very happy with the processor information at the end, but that's unrelated to the change you are proposing:

  1. I don't understand why both 'uname -m' and 'uname -p' are present in this string. Does that ever add useful information?
  2. The information does not include data about fat binaries, resulting amongst others in the following inconsistency:
ronald@Menegroth[0]$ arch -i386 python3.6 -m platform
Darwin-18.2.0-x86_64-i386-64bit

ronald@Menegroth[0]$ arch -i386 python3.6 -c 'import sys; print(sys.maxsize)'
2147483647

This platform output includes "64bit" because the binary for python3.6 includes support for both i386 and x86_64, and doesn't show that the command is using i386 instructions.