summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-2/+1
|
* bpo-37369: Fix initialization of sys members when launched via an app ↵Steve Dower2019-06-291-31/+8
| | | | | | | container (GH-14428) sys._base_executable is now always defined on all platforms, and can be overridden through configuration. Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
* bpo-35346, platform: replace os.popen() with subprocess (GH-10786)Victor Stinner2018-12-071-9/+9
| | | | | | | | | | | 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.
* bpo-35344: platform.platform() uses mac_ver() on macOS (GH-10780)Victor Stinner2018-12-051-0/+33
| | | | | 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.
* bpo-35389: platform.libc_ver() uses os.confstr() (GH-10891)Victor Stinner2018-12-051-6/+35
| | | | | | | | | | 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%)
* bpo-35345: Remove platform.popen() (GH-10781)Victor Stinner2018-11-291-33/+0
| | | | | | | 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.
* bpo-35202: Remove unused imports in tests. (GH-10561)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-161-1/+0
|
* bpo-34011: Fixes missing venv files and other tests (GH-9458)Steve Dower2018-09-201-15/+21
|
* bpo-26544: Add test for platform._comparable_version(). (GH-8973)Serhiy Storchaka2018-09-041-0/+36
|
* bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684)Serhiy Storchaka2018-07-091-1/+7
|
* Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)Victor Stinner2018-06-261-2/+4
| | | This reverts commit 8fbbdf0c3107c3052659e166f73990b466eacbb0.
* bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)Victor Stinner2018-06-221-4/+2
| | | | | | | | * Add support.MS_WINDOWS: True if Python is running on Microsoft Windows. * Add support.MACOS: True if Python is running on Apple macOS. * Replace support.is_android with support.ANDROID * Replace support.is_jython with support.JYTHON * Cleanup code to initialize unix_shell
* bpo-28167: Remove platform.linux_distribution (GH-6871)Petr Viktorin2018-05-161-65/+0
| | | | | | | | * test_ssl: Remove skip_if_broken_ubuntu_ssl We no longer support OpenSSL 0.9.8.15.15. * bpo-28167: Remove platform.linux_distribution
* bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669)Matthias Bussonnier2018-05-151-2/+2
| | | | | Also bump PendingDeprecationWarning to DeprecationWarning.
* bpo-32159: Remove tools for CVS and Subversion (#4615)Victor Stinner2017-11-281-3/+3
| | | | | | | | | | 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
* bpo-27593: Get SCM build info from git instead of hg. (#446)Ned Deily2017-03-041-6/+6
| | | | | | | 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.
* Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd filesSteve Dower2016-09-101-2/+3
|\
| * Closes #28059: Fixes test_platform to set PYTHONPATH for .pyd filesSteve Dower2016-09-101-2/+9
| |
* | test_platform: Save/restore os.environ on WindowsVictor Stinner2016-09-101-0/+7
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-2/+2
|/ | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* Issue #21313: Tolerate truncated buildinfo in sys.versionMartin Panter2016-06-081-0/+16
|
* Issue #26041: Remove "will be removed in Python 3.7" from description messagesBerker Peksag2016-04-241-4/+2
| | | | | | | We will keep platform.dist() and platform.linux_distribution() to make porting from Python 2 easier. Patch by Kumaripaba Miyurusara Athukorala.
* Issue #24210: Silence more PendingDeprecationWarning warnings in tests.Berker Peksag2015-05-161-2/+16
|
* Issue #1322: platform.dist() and platform.linux_distribution() functions are ↵Berker Peksag2015-05-131-5/+19
| | | | | | now deprecated. Initial patch by Vajrasky Kok.
* - Issue #21539: Add a *exists_ok* argument to `Pathlib.mkdir()` to mimicBarry Warsaw2014-08-051-1/+1
| | | | | | | | | | | `mkdir -p` and `os.makedirs()` functionality. When true, ignore FileExistsErrors. Patch by Berker Peksag. (With minor cleanups, additional tests, doc tweaks, etc. by Barry) Also: * Remove some unused imports in test_pathlib.py reported by pyflakes.
* Issue #17429: Oops, remove unused importVictor Stinner2013-12-081-1/+0
|
* Issue #17429: platform.linux_distribution() now decodes files from the UTF-8Victor Stinner2013-12-081-0/+16
| | | | | | | encoding with the surrogateescape error handler, instead of decoding from the locale encoding in strict mode. It fixes the function on Fedora 19 which is probably the first major distribution release with a non-ASCII name. Patch written by Toshio Kuratomi.
* #8964: fix platform._sys_version to handle IronPython 2.6+.Ezio Melotti2013-10-211-0/+13
|
* Issue #15164: Change return value of platform.uname() from aLarry Hastings2012-06-241-1/+7
| | | | plain tuple to a collections.namedtuple.
* Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'Ned Deily2011-07-131-1/+1
|\ | | | | | | as the processor type on some Mac systems.
| * Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'Ned Deily2011-07-131-1/+1
| | | | | | | | | | as the processor type on some Mac systems. Also fix NameError in fallback _mac_ver_gestalt function. And remove out-of-date URL in docs.
* | test_platform: ignore DeprecationWarning on popen() testVictor Stinner2011-06-101-15/+20
| |
* | Remove sys.subversion and svn build identification leftovers.Georg Brandl2011-03-061-5/+1
| |
* | Merge build identification to default branch.Georg Brandl2011-03-061-1/+5
|\ \ | |/
| * Merge build identification to 3.2 branch.Georg Brandl2011-03-061-1/+5
| |\
| | * Adapt platform and test_platform to the build identification changes.Georg Brandl2011-03-051-1/+5
| | |
| | * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
| | * Merged revisions 83075 via svnmerge fromRonald Oussoren2010-07-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83075 | ronald.oussoren | 2010-07-23 12:54:59 +0100 (Fri, 23 Jul 2010) | 5 lines Fix for issue 7895. Avoid crashing the interpreter when calling platform.mac_ver after calling os.fork by reading from a system configuration file instead of using OSX APIs. ........
| | * Merged revisions 77737 via svnmerge fromBenjamin Peterson2010-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77737 | benjamin.peterson | 2010-01-24 21:37:42 -0600 (Sun, 24 Jan 2010) | 9 lines Merged revisions 77735 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77735 | benjamin.peterson | 2010-01-24 21:31:13 -0600 (Sun, 24 Jan 2010) | 1 line fix an UnboundLocalError when the release file is empty #7773 ........ ................
| | * Merged revisions 74641 via svnmerge fromBrett Cannon2009-09-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74641 | brett.cannon | 2009-09-03 14:29:20 -0700 (Thu, 03 Sep 2009) | 14 lines Merged revisions 74640 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74640 | brett.cannon | 2009-09-03 14:25:21 -0700 (Thu, 03 Sep 2009) | 7 lines test_platform fails on OS X Snow Leopard because the UNIX command to get the canonical version, sw_vers, leaves off trailing zeros in the version number (e.g. 10.6 instead of 10.6.0). Test now compensates by tacking on extra zeros for the test comparison. Fixes issue #6806. ........ ................
| | * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
* | | Issue #11377: Fix quoting on Windows in test_platformVictor Stinner2011-03-031-2/+11
| | |
* | | Issue #11377: Deprecate platform.popen() and reimplement it with os.popen().Victor Stinner2011-03-031-0/+19
|/ /
* | Fix #9333. The symlink function is always available now, raising OSErrorBrian Curtin2010-12-281-2/+1
| | | | | | | | when the user doesn't hold the symbolic link privilege rather than hiding it.
* | Fix #9333. Expose os.symlink on Windows only when usable.Brian Curtin2010-12-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to create symlinks on Windows, SeCreateSymbolicLinkPrivilege is an account privilege that is required to be held by the user. Not only must the privilege be enabled for the account, the activated privileges for the currently running application must be adjusted to enable the requested privilege. Rather than exposing an additional function to be called prior to the user's first os.symlink call, we handle the AdjustTokenPrivileges Windows API call internally and only expose os.symlink when the privilege escalation was successful. Due to the change of only exposing os.symlink when it's available, we can go back to the original test skipping methods of checking via `hasattr`.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-6/+6
| |
* | Fix for issue 7895. Avoid crashing the interpreterRonald Oussoren2010-07-231-0/+19
| | | | | | | | | | | | when calling platform.mac_ver after calling os.fork by reading from a system configuration file instead of using OSX APIs.
* | Re-flow several long lines from #1578269.Brian Curtin2010-07-091-2/+2
| |
* | Implement #1578269. Patch by Jason R. Coombs.Brian Curtin2010-07-081-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added Windows support for os.symlink when run on Windows 6.0 or greater, aka Vista. Previous Windows versions will raise NotImplementedError when trying to symlink. Includes numerous test updates and additions to test_os, including a symlink_support module because of the fact that privilege escalation is required in order to run the tests to ensure that the user is able to create symlinks. By default, accounts do not have the required privilege, so the escalation code will have to be exposed later (or documented on how to do so). I'll be following up with that work next. Note that the tests use ctypes, which was agreed on during the PyCon language summit.
* | Fix porting mistake in r79298.R. David Murray2010-03-241-1/+1
| |