| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
erroneous STDIN consumption (GH-27092)
|
|
|
| |
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
|
|
|
| |
sys.getwindowsversion() (GH-25500)
The sys module uses the kernel32.dll version number, which can vary from the "actual" Windows version.
Since the best option for getting the version is WMI (which is expensive), we switch back to launching cmd.exe (which is also expensive, but a lot less code on our part).
sys.getwindowsversion() is not updated to avoid launching executables from that module.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
processor) (#23010)
* Add test capturing missed expectation with uname_result._replace.
* bpo-42163: Override uname_result._make to allow uname_result._replace to work (for everything but 'processor'.
* Replace hard-coded length with one derived from the definition.
* Add test capturing missed expectation with copy/deepcopy on namedtuple (bpo-42189).
* bpo-42189: Exclude processor parameter when constructing uname_result.
* In _make, rely on __new__ to strip processor.
* Add blurb.
* iter is not necessary here.
* Rely on num_fields in __new__
* Add test for slices on uname
* Add test for copy and pickle.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* import pickle
* Fix equality test after pickling.
* Simply rely on __reduce__ for pickling.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
| |
Automerge-Triggered-By: GH:tiran
|
|
|
|
|
|
|
| |
Add platform.freedesktop_os_release() function to parse freedesktop.org
os-release files.
Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
| |
IRIX code was slowy removed in Python 2.4 (--with-sgi-dl), Python 3.3
(Irix threads), and Python 3.7.
|
|
|
|
|
|
|
| |
(#20015)
* bpo-40570: Improve compatibility of uname_result with late-bound .platform.
* Add test capturing ability to cast uname to a tuple.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Replace flag-flip indirection with direct inspection
* Use any for simpler code
* Avoid flag flip and set results directly.
* Resolve processor in a single function.
* Extract processor handling into a namespace (class)
* Remove _syscmd_uname, unused
* Restore platform.processor behavior to match prior expectation (reliant on uname -p in a subprocess).
* Extract '_unknown_as_blank' function.
* Override uname_result to resolve the processor late.
* Add a test intended to capture the expected values from 'uname -p'
* Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p'
* Use a skipIf directive
* Use contextlib.suppress to suppress the error. Inline strip call.
* 📜🤖 Added by blurb_it.
* Remove use of contextlib.suppress (it would fail with NameError if it had any effect). Rely on _unknown_as_blank to replace unknown with blank.
Co-authored-by: blurb-it[bot] <blurb-it[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
| |
When libc_ver() is called with an executable, the
os.confstr('CS_GNU_LIBC_VERSION') fast-path cannot be taken. Modify
platform.platform() to call libc_ver() without executable, instead of
calling libc_ver(sys.executable), since sys.executable is already the
default value.
|
| |
|
| |
|
| |
|
|
|
|
| |
Add a comment explaining why system_alias() doesn't alias Darwin to
macOS.
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
| |
struct.calcsize('P') now always works.
|
|
|
|
|
|
| |
Drop Mac OS 9 and Rhapsody support from the platform module:
* Rhapsody: last release in 2000
* Mac OS 9: last release in 2001
|
|
|
|
|
|
|
|
|
|
|
| |
Replace os.popen() with subprocess.check_output() in the platform module:
* platform.uname() (its _syscmd_ver() helper function) now redirects
stderr to DEVNULL.
* Remove platform.DEV_NULL.
* _syscmd_uname() and _syscmd_file() no longer catch AttributeError.
The "except AttributeError:" was only needed in Python 2, when
os.popen() was not always available. In Python 3,
subprocess.check_output() is always available.
|
|
|
|
|
| |
On macOS, platform.platform() now uses mac_ver(), if it returns a
non-empty release string, to get the macOS version rather than darwin
version.
|
|
|
|
|
|
|
|
|
|
| |
platform.libc_ver() now uses os.confstr('CS_GNU_LIBC_VERSION') if
available and the *executable* parameter is not set. The default
value of the libc_ver() *executable* parameter becomes None.
Quick benchmark on Fedora 29:
python3 -m perf command ./python -S -c 'import platform; platform.libc_ver()'
94.9 ms +- 4.3 ms -> 33.2 ms +- 1.4 ms: 2.86x faster (-65%)
|
|
|
|
|
|
|
| |
Only platform._syscmd_file() uses subprocess. Move subprocess import
inside this function to reduce the number of imports at Python
startup.
Remove also warnings import which is no longer needed.
|
|
|
|
|
|
|
| |
Remove platform.popen() function, it was deprecated since Python 3.3:
use os.popen() instead.
Rename also the "Removed" section to "API and Feature Removals"
of What's New in Python 3.8.
|
|
|
|
|
| |
platform._dist_try_harder() was an helper function
for platform.linux_distribution() which has been removed by the
commit 8b94b41ab7b12f745dea744e8940631318816935.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* test_ssl: Remove skip_if_broken_ubuntu_ssl
We no longer support OpenSSL 0.9.8.15.15.
* bpo-28167: Remove platform.linux_distribution
|
|
|
|
|
| |
Also bump PendingDeprecationWarning to DeprecationWarning.
|
|
|
|
|
|
|
|
|
|
| |
CPython migrated from CVS to Subversion, to Mercurial, and then to
Git. CVS and Subversion are not more used to develop CPython.
* platform module: drop support for sys.subversion. The
sys.subversion attribute has been removed in Python 3.3.
* Remove Misc/svnmap.txt
* Remove Tools/scripts/svneol.py
* Remove Tools/scripts/treesync.py
|
|
|
|
|
|
|
| |
sys.version and the platform module python_build(),
python_branch(), and python_revision() functions now use
git information rather than hg when building from a repo.
Based on original patches by Brett Cannon and Steve Dower.
|
|
|
|
| |
Was bumped in the docstring by b9f4feab1b9c9ffa8ea29af3d82bc536f9f3005a
but not in `__version__`
|
| |
|
|\ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
And most of the tools.
Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
|
|/
|
|
| |
and Windows CE is no longer a relevant platform for Python.
|
|
|
|
| |
Based on patch by Ville Skyttä.
|
| |
|
|
|
|
|
|
|
| |
We will keep platform.dist() and platform.linux_distribution() to make porting
from Python 2 easier.
Patch by Kumaripaba Miyurusara Athukorala.
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
avoid compatibility shims.
|
| |
| |
| |
| | |
avoid compatibility shims.
|
| | |
|