Batuhan Taşkaya
526606baf7
bpo-38994: Implement __class_getitem__ for PathLike (GH-17498)
...
https://bugs.python.org/issue38994
2019-12-08 12:31:15 -08:00
Eddie Elizondo
b3966639d2
bpo-35381 Remove all static state from posixmodule (GH-15892)
...
After #9665 , this moves the remaining types in posixmodule to be heap-allocated to make it compatible with PEP384 as well as modifying all the type accessors to fully make the type opaque.
The original PR that got messed up a rebase: https://github.com/python/cpython/pull/10854 . All the issues in that commit have now been addressed since https://github.com/python/cpython/pull/11661 got committed.
This change also removes any state from the data segment and onto the module state itself.
https://bugs.python.org/issue35381
Automerge-Triggered-By: @encukou
2019-11-05 07:16:14 -08:00
Serhiy Storchaka
140a7d1f35
bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
...
They conflicted with keyword "in".
Also rename positional-only parameters of private os._fcopyfile()
for consistency.
2019-10-13 11:59:31 +03:00
Serhiy Storchaka
f9dc2ad890
bpo-37935: Added tests for os.walk(), glob.iglob() and Path.glob() (GH-15956)
...
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 ).
2019-09-12 13:54:48 +01:00
Steve Dower
772ec0fad5
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)
2019-09-04 14:42:54 -07:00
Zackery Spytz
5be666010e
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
2019-08-23 11:38:41 -07:00
Steve Dower
374be59b8e
bpo-37834: Fix test on Windows 7 (GH-15377)
2019-08-21 17:42:56 -07:00
Steve Dower
df2d4a6f3d
bpo-37834: Normalise handling of reparse points on Windows (GH-15231)
...
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)
2019-08-21 15:27:33 -07:00
Steve Dower
75e064962e
bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)
2019-08-21 13:43:06 -07:00
Victor Stinner
8f4ef3b019
Remove unused imports in tests (GH-14518)
2019-07-01 18:28:25 +02:00
Victor Stinner
29f609ed07
bpo-37412: Fix test_os.test_getcwd_long_path() on macOS (GH-14452)
2019-06-28 19:39:48 +02:00
Victor Stinner
ec3e20a2d1
bpo-37412: Fix os.getcwd() for long path on Windows (GH-14424)
...
* Fix test for integer overflow.
* Add an unit test.
2019-06-28 18:01:59 +02:00
Victor Stinner
689830ee62
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
...
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.
2019-06-26 17:31:12 +02:00
Victor Stinner
d7c87d982d
bpo-37400: Fix test_os.test_chown() (GH-14374)
...
Use os.getgroups() rather than grp.getgrall() to get groups.
Rename also the test to test_chown_gid().
2019-06-25 17:06:24 +02:00
Zackery Spytz
28fca0c422
bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051)
...
On Windows, os.dup() no longer creates an inheritable fd when handling a
character file.
2019-06-17 09:17:14 +02:00
Pablo Galindo
aac4d0342c
bpo-26826: Expose copy_file_range in the os module (GH-7255)
2019-05-31 19:39:47 +01:00
Christian Heimes
6eb814b8ce
bpo-37098: Skip memfd_create test before Linux 3.17 (GH-13677)
2019-05-30 11:27:06 +02:00
Zackery Spytz
43fdbd2729
bpo-26836: Add os.memfd_create() ( #13567 )
...
* 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.
2019-05-29 21:57:03 +02:00
pxinwr
f2d7ac7e5b
bpo-31904: Add posix module support for VxWorks (GH-12118)
2019-05-21 12:46:37 +02:00
Paul Monson
62dfd7d6fe
bpo-35920: Windows 10 ARM32 platform support (GH-11774)
2019-04-25 18:36:45 +00:00
Berker Peksag
6ef726af3e
bpo-29734: Cleanup test_getfinalpathname_handles test (GH-12908)
2019-04-22 18:46:28 +03:00
Victor Stinner
876e82b4f3
bpo-36234: Add more tests to PosixUidGidTests (GH-12234)
...
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>
2019-03-11 13:57:53 +01:00
Serhiy Storchaka
5b10b98247
bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)
2019-03-05 10:06:26 +02:00
Anthony Sottile
8377cd4fcd
Clean up code which checked presence of os.{stat,lstat,chmod} ( #11643 )
2019-02-25 23:32:27 +01:00
Serhiy Storchaka
8d01eb49fc
Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)
2019-02-19 13:52:35 +02:00
Pablo Galindo
09fbcd6085
bpo-35942: Improve the error message if __fspath__ returns invalid types in 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.
2019-02-18 10:46:34 +00:00
pxinwr
3e028b2d40
bpo-35994: add sub dir for sub2_tree in os.walk test if symlink is not supported (GH-11853)
...
https://bugs.python.org/issue35994
2019-02-14 21:04:47 -08:00
Mark Becwar
b82bfac436
bpo-29734: nt._getfinalpathname handle leak (GH-740)
...
Make sure that failure paths call CloseHandle outside of the function that failed
2019-02-02 13:08:23 -08:00
Serhiy Storchaka
32bc11c33c
bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)
2018-12-01 14:30:20 +02:00
Alexey Izbyshev
834603112e
bpo-32890, os: Use errno instead of GetLastError() in execve() and 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.
2018-10-20 02:28:22 +02:00
Benjamin Peterson
84db4a9978
closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273)
2018-09-13 12:00:14 -07:00
Oren Milman
0bd1a2dcfd
bpo-31577: Fix a crash in os.utime() in case of a bad ns argument. (GH-3752)
2018-09-12 22:14:35 +03:00
Berker Peksag
e0b5b2096e
bpo-34384: Fix os.readlink() on Windows (GH-8740)
...
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.
2018-08-15 13:03:41 +03:00
Serhiy Storchaka
9d5727326a
bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)
...
* 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.
2018-07-31 10:24:54 +03:00
Steve Dower
6921e73e33
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)
2018-03-05 14:26:08 -08:00
Serhiy Storchaka
b21d155f57
bpo-32964: Reuse a testing implementation of the path protocol in tests. ( #5930 )
2018-03-02 11:53:51 +02:00
SSE4
3c34aad4e7
bpo-29248: Fix os.readlink() on Windows (GH-5577)
...
The PrintNameOffset field of the reparse data buffer
was treated as a number of characters instead of bytes.
2018-02-12 20:10:35 +03:00
Victor Stinner
13ff24582c
bpo-32593: Drop FreeBSD 9 and older support ( #5232 )
...
Drop support of FreeBSD 9 and older.
2018-01-22 18:32:50 +01:00
Benjamin Peterson
bbdb17d19b
return the new file descriptor from os.dup2 (closes bpo-32441) ( #5041 )
2017-12-29 13:13:06 -08:00
Giuseppe Scrivano
96a5e50a5d
bpo-32143: add f_fsid to os.statvfs() ( #4571 )
...
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2017-12-14 17:46:46 -05:00
Pablo Galindo
fb77e0d855
Fix hardcoded value in test_os.py ( #4744 )
2017-12-07 07:55:44 +01:00
xdegaye
6a55d09573
bpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374)
2017-11-12 17:57:04 +01:00
Victor Stinner
8c663fd60e
Replace KB unit with KiB ( #4293 )
...
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.
2017-11-08 14:44:44 -08:00
Victor Stinner
c29b585fd4
bpo-31784: Implement PEP 564: add time.time_ns() ( #3989 )
...
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
2017-11-02 07:28:27 -07:00
Benjamin Peterson
4eaf7f9490
fixes bpo-31866: remove code pertaining to AtheOS support ( #4115 )
...
We stop support this OS in 2007 with commit
19fab761b7
. Let's finish.
2017-10-25 23:55:14 -07:00
Victor Stinner
01b5aab7bf
bpo-31827: Remove os.stat_float_times() (GH-4061)
2017-10-24 02:02:00 -07:00
Victor Stinner
a8e7d903d7
os.test_utime_current(): tolerate 50 ms delta ( #3646 )
2017-09-18 08:49:45 -07:00
Antoine Pitrou
a6a4dc816d
bpo-31370: Remove support for threads-less builds ( #3385 )
...
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Ville Skyttä
49b2734bf1
Spelling fixes ( #2902 )
2017-08-03 09:00:59 +03:00
Victor Stinner
d1cc037d14
bpo-30908: Fix dangling thread in test_os.TestSendfile ( #2680 )
...
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
2017-07-12 16:05:43 +02:00
Serhiy Storchaka
1180e5a518
bpo-30879: os.listdir() and os.scandir() now emit bytes names when ( #2634 )
...
called with bytes-like argument.
2017-07-11 06:36:46 +03:00
Osvaldo Santana Neto
8a8d28501f
bpo-30441: Fix bug when modifying os.environ while iterating over it ( #2409 )
2017-07-01 20:34:45 +03:00
Serhiy Storchaka
af5392f5c6
bpo-30746: Port more tests for os.spawnvpe() and os.execve() from 2.7. ( #2394 )
2017-06-25 09:48:54 +03:00
Serhiy Storchaka
77703942c5
bpo-30746: Prohibited the '=' character in environment variable names ( #2382 )
...
in `os.putenv()` and `os.spawn*()`.
2017-06-25 07:33:01 +03:00
Victor Stinner
3402f72688
bpo-30649: Revert utime delta in test_os ( #2176 )
...
PPC64 Fedora 3.x buildbot requires at least a delta of 14 ms: revert
the utime delta to 20 ms.
I tried 10 ms, but test_os failed on the PPC64 Fedora 3.x buildbot.
2017-06-14 11:55:17 +02:00
Victor Stinner
c94caca65c
bpo-30649: test_os tolerates 50 ms delta for utime ( #2156 )
...
On Windows, tolerate a delta of 50 ms instead of 20 ms in
test_utime_current() and test_utime_current_old() of test_os.
On other platforms, reduce the delta from 20 ms to 10 ms.
2017-06-13 23:48:27 +02:00
Denis Osipov
897bba7563
bpo-30584: Fix test_os fails on non-English Windows ( #1980 )
...
* Fix bpo-30584
* Adding a comment mentionning the bpo and explaining what is the identifier
* Add Denis Osipov to Misc/ACKS
2017-06-07 19:15:26 +02:00
Serhiy Storchaka
ea720fe7e9
bpo-25996: Added support of file descriptors in os.scandir() on Unix. ( #502 )
...
os.fwalk() is sped up by 2 times by using os.scandir().
2017-03-30 09:12:31 +03:00
Serhiy Storchaka
e304e33c16
bpo-19930: The mode argument of os.makedirs() no longer affects the file ( #799 )
...
permission bits of newly-created intermediate-level directories.
2017-03-24 13:27:42 +02:00
Serhiy Storchaka
8f6b344d36
bpo-28682: Added support for bytes paths in os.fwalk(). ( #489 )
2017-03-07 14:33:21 +02:00
Serhiy Storchaka
70d28a184c
Remove unused imports.
2016-12-16 20:00:15 +02:00
Steve Dower
bce26262d1
Issue #28732 : Raise ValueError when argv[0] is empty
2016-11-19 19:17:26 -08:00
Steve Dower
859fd7bd7a
Issue #28732 : Raise ValueError when os.spawn*() is passed an empty tuple of arguments
2016-11-19 18:53:19 -08:00
Xavier de Gaye
21060105d9
Issue #26935 : Fix broken Android dup2() in test_os
2016-11-16 08:05:27 +01:00
Steve Dower
78057b4159
Closes #27781 : Removes special cases for the experimental aspect of PEP 529
2016-11-06 19:35:08 -08:00
Serhiy Storchaka
b6bd81dee9
Issue #28353 : Make test_os.WalkTests.test_walk_bad_dir stable.
2016-10-28 09:18:30 +03:00
Serhiy Storchaka
7865dfff2e
Issue #28353 : Make test_os.WalkTests.test_walk_bad_dir stable.
2016-10-28 09:17:38 +03:00
Serhiy Storchaka
36888dd970
Issue #28353 : Fixed tests of os.fwalk() with broken links.
2016-10-25 20:18:31 +03:00
Serhiy Storchaka
28f982060c
Issue #28353 : Try to fix tests.
2016-10-25 19:01:41 +03:00
Serhiy Storchaka
af4e4747f5
Issue #28353 : os.fwalk() no longer fails on broken links.
2016-10-25 14:34:38 +03:00
Serhiy Storchaka
42bababba6
Issue #28353 : os.fwalk() no longer fails on broken links.
2016-10-25 14:28:38 +03:00
Berker Peksag
bf3c1c3235
Issue #28075 : Fix test_access_denied in Python 3.5
...
I forgot there two variations of os.stat() in Python 3.5.
2016-09-18 13:56:29 +03:00
Berker Peksag
9a1c91a10d
Fix test_access_denied in 3.5
2016-09-17 16:20:55 +03:00
Berker Peksag
052e4f18c4
Issue #28075 : Merge from 3.5
2016-09-17 15:51:14 +03:00
Berker Peksag
0b4dc4846b
Issue #28075 : Check for ERROR_ACCESS_DENIED in Windows implementation of os.stat()
...
Patch by Eryk Sun.
2016-09-17 15:49:59 +03:00
Berker Peksag
4af23d7ddd
Use requires_os_func() to skip SpawnTests
2016-09-15 20:32:44 +03:00
Berker Peksag
47e7062f76
Make SpawnTest.create_args() keyword-only
2016-09-15 20:23:55 +03:00
Berker Peksag
8181646931
Issue #28114 : Fix a crash in parse_envlist() when env contains byte strings
...
Patch by Eryk Sun.
2016-09-15 20:19:47 +03:00
Victor Stinner
4659ccff70
Issue #28114 : Add unit tests on os.spawn*()
2016-09-14 10:57:00 +02:00
Martin Panter
99e843b48e
Correct spelling in documentation and code comment
2016-09-10 10:38:28 +00:00
Steve Dower
3929499914
Issue #1602 : Windows console doesn't input or print Unicode (PEP 528)
...
Closes #17602 : Adds a readline implementation for the Windows console
2016-08-30 21:22:36 -07:00
R David Murray
44b548dda8
#27364 : fix "incorrect" uses of escape character in the stdlib.
...
And most of the tools.
Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
2016-09-08 13:59:53 -04:00
Steve Dower
cc16be85c0
Issue #27781 : Change file system encoding on Windows to UTF-8 (PEP 529)
2016-09-08 10:35:16 -07:00
Victor Stinner
173a1f3dc7
Fix test_os.GetRandomTests()
...
Issue #27778 : Skip getrandom() tests if getrandom() fails with ENOSYS.
2016-09-06 19:57:40 -07:00
Victor Stinner
9b1f474df6
Add os.getrandom()
...
Issue #27778 : Expose the Linux getrandom() syscall as a new os.getrandom()
function.
This change is part of the PEP 524.
2016-09-06 16:18:52 -07:00
Brett Cannon
ec6ce879c7
Issue #26027 : Support path-like objects in PyUnicode-FSConverter().
...
This is to add support for os.exec*() and os.spawn*() functions. Part
of PEP 519.
2016-09-06 15:50:29 -07:00
Benjamin Peterson
a9ab165cd2
os.access does not allow a fd
2016-09-05 15:40:59 -07:00
Berker Peksag
d0f5bab21b
Issue #26027 : Fix test_path_t_converter on Windows
2016-08-27 21:26:35 +03:00
Brett Cannon
3ce2fd484b
Don't test for path-like bytes paths on Windows
2016-08-27 09:42:40 -07:00
Brett Cannon
8f96a30630
Issue #26027 : Don't test for bytearray in path_t as that's now
...
deprecated.
2016-08-26 19:30:11 -07:00
Brett Cannon
3f9183b5ac
Issue #26027 , #27524 : Add PEP 519/__fspath__() support to os and
...
os.path.
Thanks to Jelle Zijlstra for the initial patch against posixmodule.c.
2016-08-26 14:44:48 -07:00
Serhiy Storchaka
d73c31899e
Issue #26800 : Undocumented support of general bytes-like objects
...
as paths in os functions is now deprecated.
2016-08-06 23:22:08 +03:00
Xavier de Gaye
d141531eb5
Issue #27472 : Add test.support.unix_shell as the path to the default shell.
2016-07-22 12:15:29 +02:00
Brett Cannon
33ed881f79
Fix a failing test introduced as part of issue #27512
2016-07-15 11:26:53 -07:00
Brett Cannon
044283a426
Issue #27512 : Don't segfault when os.fspath() calls an object whose
...
__fspath__() raises an exception.
Thanks to Xiang Zhang for the patch.
2016-07-15 10:41:49 -07:00
Brett Cannon
a32c4d0531
Issue #27038 : Expose DirEntry as os.DirEntry.
...
Thanks to Jelle Zijlstra for the code portion of the patch.
2016-06-24 14:14:44 -07:00
Brett Cannon
c78ca1e044
Issue #27186 : Update os.fspath()/PyOS_FSPath() to check the return
...
type of __fspath__().
As part of this change, also make sure that the pure Python
implementation of os.fspath() is tested.
2016-06-24 12:03:43 -07:00
Martin Panter
0c9ad59dab
Issue #27186 : Skip scandir(bytes) test with os.name == "nt"
2016-06-13 03:28:35 +00:00
Brett Cannon
41ae559108
Issue #27186 : skip bytes path test for os.scandir() on Windows
2016-06-12 11:11:20 -07:00
Brett Cannon
96881cd621
Issue #27186 : Add os.PathLike support to DirEntry
...
Initial patch thanks to Jelle Zijlstra.
2016-06-10 14:37:21 -07:00
Ethan Furman
228c636908
issue27186: fix fsencode/fsdecode and update tests; patch by Jelle Zijlstra
2016-06-04 13:47:39 -07:00
Ethan Furman
958b3e4058
issue27186: add PathLike ABC
2016-06-04 12:49:35 -07:00
Ethan Furman
410ef8e230
issue27186: add C version of os.fspath(); patch by Jelle Zijlstra
2016-06-04 12:06:26 -07:00
Ethan Furman
c1cbeedf0c
issue27182: update fsencode and fsdecode for os.path(); patch by Dusty Phillips
2016-06-04 10:19:27 -07:00
Ethan Furman
cdc0879d3a
issue27186 -- initial docs, tests, and python version of os.fspath
2016-06-02 15:06:09 -07:00
Serhiy Storchaka
9e9235511e
Issue #26783 : test_os.WalkTests.test_walk_topdown did't test fwalk and bytes.
...
Patch by Aviv Palivoda.
2016-04-16 17:51:17 +03:00
Serhiy Storchaka
a07ab29a79
Issue #26783 : test_os.WalkTests.test_walk_topdown did't test fwalk and bytes.
...
Patch by Aviv Palivoda.
2016-04-16 17:51:00 +03:00
Victor Stinner
53b0a41d31
Issue #25911 : more info on test_os failure
2016-03-26 01:12:36 +01:00
Victor Stinner
e984eb501b
Fix test_os.test_symlink(): remove create symlink
2016-03-25 22:51:17 +01:00
Victor Stinner
32830149d8
changeset: 100749:0b61b2d28a07
...
tag: tip
parent: 100742:ebae81b31cf6
user: Victor Stinner <victor.stinner@gmail.com>
date: Fri Mar 25 15:03:34 2016 +0100
files: Lib/test/test_os.py
description:
test_os: Win32ErrorTests checks if file exists
Don't use os.path.exists() since it ignores *any* OSError.
2016-03-25 15:12:08 +01:00
Victor Stinner
e77c974357
test_os: Win32ErrorTests now ensures that TESTFN doesn't exist
...
Replace also other open(filename, "w") with open(filename, "x") to fail if a
previous test forgot to remove filename.
2016-03-25 10:28:23 +01:00
Victor Stinner
3899b549e3
test_os: use support.rmtree() to cleanup WalkTests
2016-03-24 17:21:17 +01:00
Victor Stinner
ae39d236b4
Enhance and modernize test_os
...
* add create_file() helper function
* create files using "x" mode instead of "w" to detect when a previous test
forget to remove a file
* open file for writing in unbuferred mode (buffering=0)
* replace "try/finally: unlink" with self.addCleanup(support.unlink)
* register unlink cleanup function *before* creating new files
2016-03-24 17:12:55 +01:00
Victor Stinner
f95a19b900
test_os: use @support.requires_linux_version
2016-03-24 16:50:41 +01:00
Victor Stinner
923590e397
Fix DeprecationWarning on Windows
...
Issue #25911 : Use support.check_warnings() to expect or ignore
DeprecationWarning in test_os.
2016-03-24 09:11:48 +01:00
Serhiy Storchaka
786e922054
Issue #25911 : Tring to silence deprecation warnings in bytes path walk tests.
2016-03-08 21:26:44 +02:00
Serhiy Storchaka
ada6db7870
Issue #25911 : Tring to silence deprecation warnings in bytes path walk tests.
2016-03-08 21:26:26 +02:00
Serhiy Storchaka
706379ae0d
Backed out changeset da020e408c7f
2016-03-08 21:16:47 +02:00
Serhiy Storchaka
7ab61ae8aa
Backed out changeset f9e22717722d
2016-03-08 21:15:43 +02:00
Serhiy Storchaka
adca8464b1
Backed out changeset 19a3e0e664af
2016-03-08 21:13:35 +02:00
Serhiy Storchaka
238fecd75c
Issues #23808 , #25911 : Trying to fix walk tests on Windows.
...
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
2016-03-08 16:12:46 +02:00
Serhiy Storchaka
55e3218eee
Issues #23808 , #25911 : Trying to fix walk tests on Windows.
...
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
2016-03-08 16:12:09 +02:00
Serhiy Storchaka
388b90f28e
Issues #23808 , #25911 : Trying to fix walk tests on Windows.
...
On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.
2016-03-08 16:11:26 +02:00
Serhiy Storchaka
ffe96ae10b
Issue #25994 : Added the close() method and the support of the context manager
...
protocol for the os.scandir() iterator.
2016-02-11 13:21:30 +02:00
Serhiy Storchaka
79ad897052
Issue #25911 : Restored support of bytes paths in os.walk() on Windows.
2016-02-08 16:24:15 +02:00
Serhiy Storchaka
5f6a0b4eb2
Issue #25911 : Restored support of bytes paths in os.walk() on Windows.
2016-02-08 16:23:28 +02:00
Serhiy Storchaka
85896f72d5
Issue #25860 : Fixed test failure caused by inconsistency of os.walk() and
...
os.fwalk() parameter names.
2015-12-23 00:37:50 +02:00
Serhiy Storchaka
a17ca19d34
Issue #25860 : Fixed test failure caused by inconsistency of os.walk() and
...
os.fwalk() parameter names.
2015-12-23 00:37:34 +02:00
Serhiy Storchaka
345e78e566
Issue #25860 : os.fwalk() no longer skips remaining directories when error occurs.
...
Original patch by Samson Lee.
2015-12-23 00:09:01 +02:00
Serhiy Storchaka
0bddc9eb15
Issue #25860 : os.fwalk() no longer skips remaining directories when error occurs.
...
Original patch by Samson Lee.
2015-12-23 00:08:24 +02:00
Martin Panter
5e02af4961
Issue #25583 : Merge makedirs fix from 3.5
2015-11-20 02:37:29 +00:00
Martin Panter
97cabb9fa5
Issue #25583 : Merge makedirs fix from 3.4 into 3.5
2015-11-20 02:35:46 +00:00
Martin Panter
a82642f9db
Issue #25583 : Avoid incorrect errors raised by os.makedirs(exist_ok=True)
2015-11-19 04:48:44 +00:00
Martin Panter
e56a919100
Issue #25523 : Merge a-to-an corrections from 3.5
2015-11-02 04:27:17 +00:00
Martin Panter
2eb819f7a8
Issue #25523 : Merge "a" to "an" fixes from 3.4 into 3.5
2015-11-02 04:04:57 +00:00
Martin Panter
7462b64911
Issue #25523 : Correct "a" article to "an" article
...
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
2015-11-02 03:37:02 +00:00
Victor Stinner
bae2d6203f
Issue #25003 : On Solaris 11.3 or newer, os.urandom() now uses the getrandom()
...
function instead of the getentropy() function. The getentropy() function is
blocking to generate very good quality entropy, os.urandom() doesn't need such
high-quality entropy.
2015-10-01 09:47:30 +02:00
Victor Stinner
d8f432a98c
Issue #25003 : Skip test_os.URandomFDTests on Solaris 11.3 and newer
...
When os.urandom() is implemented with the getrandom() function, it doesn't use
a file descriptor.
2015-09-18 16:24:31 +02:00
Victor Stinner
024364a89a
Merge 3.5 (os.waitpid)
2015-09-15 10:24:27 +02:00
Victor Stinner
d3ffd32767
Issue #25118 : Fix a regression of Python 3.5.0 in os.waitpid() on Windows.
...
Add an unit test on os.waitpid()
2015-09-15 10:11:03 +02:00
Serhiy Storchaka
233cdb3e9c
Marked keystrokes with the :kbd: role.
...
Fixed the case of the "Ctrl-" prefixes.
2015-09-12 17:46:56 +03:00
Serhiy Storchaka
153627c111
Marked keystrokes with the :kbd: role.
...
Fixed the case of the "Ctrl-" prefixes.
2015-09-12 17:46:20 +03:00
Serhiy Storchaka
0424eaf753
Marked keystrokes with the :kbd: role.
...
Fixed the case of the "Ctrl-" prefixes.
2015-09-12 17:45:25 +03:00
Martin Panter
3f560c16e5
Merge 3.5 into 3.6
2015-09-09 06:28:08 +00:00
Martin Panter
6088b7bd49
Merge 3.4 into 3.5
2015-09-09 06:27:43 +00:00
Martin Panter
9499413508
os.sendfile(headers=None, trailers=None) arguments are not actually accepted
...
Needs to be tested on a BSD.
2015-09-09 05:29:24 +00:00
Martin Panter
a122b5a1fd
Issue #23738 : Merge 3.5 into 3.6
2015-09-09 03:01:17 +00:00
Martin Panter
0ff89099c7
Issue #23738 : Merge 3.4 into 3.5
2015-09-09 01:56:53 +00:00
Martin Panter
bf19d16950
Issue #23738 : Document and test actual keyword parameter names
...
Also fix signature because os.utime(..., ns=None) is not allowed.
2015-09-09 01:01:13 +00:00
Berker Peksag
95e0960220
Use setUpClass and tearDownClass correctly in test_os.
...
According to the documentation, they must be decorated as classmethods.
2015-07-21 09:30:09 +03:00