summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42780: Fix set_inheritable() for O_PATH file descriptors on Linux ↵cptpcrd2021-01-211-0/+27
| | | | | (GH-24172) (GH-24277) (cherry picked from commit 7dc71c425cf6aa6a4070a418dce5d95ca435c79f)
* bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)Victor Stinner2020-04-221-5/+30
| | | | | Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number.
* [3.8] bpo-38878: Fix os.PathLike __subclasshook__ (GH-17336) (GH-17684)Bar Harel2019-12-231-0/+8
| | | | https://bugs.python.org/issue38878
* bpo-37935: Added tests for os.walk(), glob.iglob() and Path.glob() ↵Miss Islington (bot)2019-09-121-0/+25
| | | | | | | | | | (GH-15956) (GH-16043) Test that they do not keep too many file descriptors open for the host OS in a reasonable test scenario. See [bpo-37935](https://bugs.python.org/issue37935). (cherry picked from commit f9dc2ad89032201427ed5f08061c703794627ad9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)Miss Islington (bot)2019-09-041-0/+8
| | | | | (cherry picked from commit 772ec0fad57412daa53d16d7019b6b2fe6e94942) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)Miss Islington (bot)2019-08-231-0/+5
| | | | | (cherry picked from commit 5be666010e4df65dc4d831435cc92340ea369f94) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-37834: Fix test on Windows 7 (GH-15377)Miss Islington (bot)2019-08-221-0/+3
| | | | | (cherry picked from commit 374be59b8e479afa8c7a8ae6e77e98915e2f6d45) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-37834: Normalise handling of reparse points on Windows (GH-15370)Steve Dower2019-08-211-14/+47
| | | | | | | | | | bpo-37834: Normalise handling of reparse points on Windows * ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed) * nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point) * nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour) * nt.readlink() will read destinations for symlinks and junction points only bpo-1311: os.path.exists('nul') now returns True on Windows * nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
* bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)Miss Islington (bot)2019-08-211-4/+1
| | | | | (cherry picked from commit 75e064962ee0e31ec19a8081e9d9cc957baf6415) Co-authored-by: Steve Dower <steve.dower@python.org>
* Remove unused imports in tests (GH-14518) (GH-14520)Victor Stinner2019-07-011-1/+0
| | | (cherry picked from commit 8f4ef3b019ce380022018587571b0f970e668de3)
* bpo-37412: Fix test_os.test_getcwd_long_path() on macOS (GH-14452)Miss Islington (bot)2019-06-281-2/+1
| | | | | (cherry picked from commit 29f609ed07aa7856741ff8b8b8b050369d0faf81) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37412: Fix os.getcwd() for long path on Windows (GH-14424) (GH-14451)Miss Islington (bot)2019-06-281-0/+55
| | | | | | | * Fix test for integer overflow. * Add an unit test. (cherry picked from commit ec3e20a2d1edddb0558f9d32e2b367904ccdde88) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)Miss Islington (bot)2019-06-261-0/+11
| | | | | | | | | | | | The os.getcwdb() function now uses the UTF-8 encoding on Windows, rather than the ANSI code page: see PEP 529 for the rationale. The function is no longer deprecated on Windows. os.getcwd() and os.getcwdb() now detect integer overflow on memory allocations. On Unix, these functions properly report MemoryError on memory allocation failure. (cherry picked from commit 689830ee6243126798a6c519c05aa11ba73db7cd) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37400: Fix test_os.test_chown() (GH-14374)Miss Islington (bot)2019-06-251-11/+8
| | | | | | | Use os.getgroups() rather than grp.getgrall() to get groups. Rename also the test to test_chown_gid(). (cherry picked from commit d7c87d982d4ec4ba201bcee14324ae5e0e90581f) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051) ↵Miss Islington (bot)2019-06-171-0/+9
| | | | | | | | | (GH-14140) On Windows, os.dup() no longer creates an inheritable fd when handling a character file. (cherry picked from commit 28fca0c422b425a6be43be31add0a5328c16b0b8) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-26826: Expose copy_file_range in the os module (GH-7255)Pablo Galindo2019-05-311-0/+83
|
* bpo-37098: Skip memfd_create test before Linux 3.17 (GH-13677)Christian Heimes2019-05-301-0/+1
|
* bpo-26836: Add os.memfd_create() (#13567)Zackery Spytz2019-05-291-0/+16
| | | | | | | | | | | | | | | | | | | | * bpo-26836: Add os.memfd_create() * Use the glibc wrapper for memfd_create() Co-Authored-By: Christian Heimes <christian@python.org> * Fix deletions caused by autoreconf. * Use MFD_CLOEXEC as the default value for *flags*. * Add memset_s to configure.ac. * Revert memset_s changes. * Apply the requested changes. * Tweak the docs.
* bpo-31904: Add posix module support for VxWorks (GH-12118)pxinwr2019-05-211-1/+4
|
* bpo-35920: Windows 10 ARM32 platform support (GH-11774)Paul Monson2019-04-251-1/+2
|
* bpo-29734: Cleanup test_getfinalpathname_handles test (GH-12908)Berker Peksag2019-04-221-21/+14
|
* bpo-36234: Add more tests to PosixUidGidTests (GH-12234)Victor Stinner2019-03-111-8/+20
| | | | | | | | | | test_posix.PosixUidGidTests: * Add tests for invalid uid/gid type (str) * Add UID_OVERFLOW and GID_OVERFLOW constants to replace (1 << 32) Initial patch written by David Malcolm. Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)Serhiy Storchaka2019-03-051-3/+2
|
* Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)Anthony Sottile2019-02-251-1/+0
|
* Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)Serhiy Storchaka2019-02-191-12/+4
|
* bpo-35942: Improve the error message if __fspath__ returns invalid types in ↵Pablo Galindo2019-02-181-1/+18
| | | | | path_converter (GH-11831) The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error.
* bpo-35994: add sub dir for sub2_tree in os.walk test if symlink is not ↵pxinwr2019-02-151-1/+1
| | | | | supported (GH-11853) https://bugs.python.org/issue35994
* bpo-29734: nt._getfinalpathname handle leak (GH-740)Mark Becwar2019-02-021-0/+56
| | | Make sure that failure paths call CloseHandle outside of the function that failed
* bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)Serhiy Storchaka2018-12-011-0/+23
|
* bpo-32890, os: Use errno instead of GetLastError() in execve() and ↵Alexey Izbyshev2018-10-201-0/+10
| | | | | | | | | | truncate() (GH-5784) path_error() uses GetLastError() on Windows, but some os functions are implemented via CRT APIs which report errors via errno. This may result in raising OSError with invalid error code (such as zero). Introduce posix_path_error() function and use it where appropriate.
* closes bpo-34664: Only check file permission bits of newly created ↵Benjamin Peterson2018-09-131-2/+2
| | | | directories. (GH-9273)
* bpo-31577: Fix a crash in os.utime() in case of a bad ns argument. (GH-3752)Oren Milman2018-09-121-0/+16
|
* bpo-34384: Fix os.readlink() on Windows (GH-8740)Berker Peksag2018-08-151-0/+47
| | | | | | | | | os.readlink() now accepts path-like and bytes objects on Windows. Previously, support for path-like and bytes objects was only implemented on Unix. This commit also merges Unix and Windows implementations of os.readlink() in one function and adds basic unit tests to increase test coverage of the function.
* bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)Serhiy Storchaka2018-07-311-15/+35
| | | | | | | | | | | | * Fix integer overflow in os.readv(), os.writev(), os.preadv() and os.pwritev() and in os.sendfile() with headers or trailers arguments (on BSD-based OSes and MacOS). * Fix sending the part of the file in os.sendfile() on MacOS. Using the trailers argument could cause sending more bytes from the input file than was specified. Thanks Ned Deily for testing on 32-bit MacOS.
* bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)Steve Dower2018-03-051-0/+34
|
* bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930)Serhiy Storchaka2018-03-021-30/+14
|
* bpo-29248: Fix os.readlink() on Windows (GH-5577)SSE42018-02-121-0/+15
| | | | The PrintNameOffset field of the reparse data buffer was treated as a number of characters instead of bytes.
* bpo-32593: Drop FreeBSD 9 and older support (#5232)Victor Stinner2018-01-221-3/+1
| | | Drop support of FreeBSD 9 and older.
* return the new file descriptor from os.dup2 (closes bpo-32441) (#5041)Benjamin Peterson2017-12-291-10/+6
|
* bpo-32143: add f_fsid to os.statvfs() (#4571)Giuseppe Scrivano2017-12-141-0/+5
| | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Fix hardcoded value in test_os.py (#4744)Pablo Galindo2017-12-071-1/+1
|
* bpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374)xdegaye2017-11-121-3/+10
|
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-2/+2
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* bpo-31784: Implement PEP 564: add time.time_ns() (#3989)Victor Stinner2017-11-021-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Add new time functions: * time.clock_gettime_ns() * time.clock_settime_ns() * time.monotonic_ns() * time.perf_counter_ns() * time.process_time_ns() * time.time_ns() Add new _PyTime functions: * _PyTime_FromTimespec() * _PyTime_FromNanosecondsObject() * _PyTime_FromTimeval() Other changes: * Add also os.times() tests to test_os. * pytime_fromtimeval() and pytime_fromtimeval() now return _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined behaviour * _PyTime_FromNanoseconds() parameter type changes from long long to _PyTime_t
* fixes bpo-31866: remove code pertaining to AtheOS support (#4115)Benjamin Peterson2017-10-261-12/+2
| | | | We stop support this OS in 2007 with commit 19fab761b71a1687aee3415db3a937b5ce31975d. Let's finish.
* bpo-31827: Remove os.stat_float_times() (GH-4061)Victor Stinner2017-10-241-17/+0
|
* os.test_utime_current(): tolerate 50 ms delta (#3646)Victor Stinner2017-09-181-5/+4
|
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-79/+75
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Spelling fixes (#2902)Ville Skyttä2017-08-031-7/+7
|
* bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680)Victor Stinner2017-07-121-0/+1
| | | | | | | | | | | | | tearDown() now clears explicitly the self.server variable to make sure that the thread is completely cleared when tearDownClass() checks if all threads have been cleaned up. Fix the following warning: $ ./python -m test --fail-env-changed -m test.test_os.TestSendfile.test_keywords -R 3:1 test_os (...) Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 2) (...) Tests result: ENV CHANGED