Commit Graph

933 Commits

Author SHA1 Message Date
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
Ned Deily eb3be66b3a Issue #27736: Prevent segfault after interpreter re-initialization due
to ref count problem introduced in code for Issue #27038 in 3.6.0a3.
Patch by Xiang Zhang.
2016-08-15 14:40:38 -04: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
Martin Panter 70214ad55d Issue #17599: Use unique _Py_REPARSE_DATA_BUFFER etc names to avoid conflict
The conflict occurs with Min GW, which already defines REPARSE_DATA_BUFFER.
Also, Min GW uses a lowercase <windows.h> filename.
2016-08-04 02:38:59 +00:00
Benjamin Peterson bf5868d2c5 merge 3.5 (#27656) 2016-07-30 23:22:24 -07:00
Benjamin Peterson dbaa559b7f all SCHED_ constants are optional (closes #27656) 2016-07-30 23:21:50 -07:00
Steve Dower 262dc1e71d Issue #27533: Release GIL in nt._isdir 2016-07-17 20:50:28 -07:00
Steve Dower b22a67737e Issue #27533: Release GIL in nt._isdir 2016-07-17 20:49:38 -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
Serhiy Storchaka 2954f83999 - Issue #27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic.  Patch by Petr Viktorin.
2016-07-07 18:20:03 +03:00
Serhiy Storchaka 1a2b24f02d Issue #27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic.  Patch by Petr Viktorin.
2016-07-07 17:35:15 +03: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
doko@ubuntu.com fcff437de3 - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants
exposed on the API which are not implemented on GNU/Hurd. They would not
  work at runtime anyway.
2016-06-13 16:33:04 +02: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
Brett Cannon b4f43e90d9 Clarify documentation for os.fspath(). 2016-06-09 14:32:08 -07:00
Ethan Furman 410ef8e230 issue27186: add C version of os.fspath(); patch by Jelle Zijlstra 2016-06-04 12:06:26 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 46833e73af Fix issue27146 - add stdio.h include to posixmodule.c for ctermid(). 2016-05-28 21:06:41 +00:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) fa76eeec70 Fix issue27146 - add stdio.h include to posixmodule.c for ctermid(). 2016-05-28 21:03:48 +00:00
Serhiy Storchaka deab18dfd0 Issue #26708: Use the "const" qualifier for immutable strings.
This can help to avoid unintentional modification.
2016-05-07 16:45:18 +03:00
Serhiy Storchaka c2f7d87897 Issue #26932: Fixed support of RTLD_* constants defined as enum values,
not via macros (in particular on Android).  Patch by Chi Hsuan Yen.
2016-05-04 09:44:44 +03:00
Stefan Krah fb7c8ae4e7 Issue #26863: HAVE_FACCESSAT should (currently) not be defined on Android. 2016-04-26 17:04:18 +02:00
Serhiy Storchaka 3291d85a2f Issue #26671: Fixed #ifdef indentation. 2016-04-06 23:02:46 +03:00
Serhiy Storchaka aaf553bac4 Backed out changeset 8dc144e47252 2016-04-06 23:02:25 +03:00
Serhiy Storchaka 026110f0a2 Issue #26671: Fixed #ifdef indentation. 2016-04-06 22:55:31 +03:00
Serhiy Storchaka 819399b2ab Issue #26671: Enhanced path_converter.
Exceptions raised during converting argument of correct type are no longer
overridded with TypeError. Some error messages are now more detailed.
2016-04-06 22:17:52 +03:00
Serhiy Storchaka ab479c49d3 Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:41:15 +03:00
Serhiy Storchaka fbb1c5ee06 Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
2016-03-30 20:40:02 +03:00
Victor Stinner 7bfa409ff8 Implement finalizer for os.scandir() iterator
Issue #26603:

* Implement finalizer for os.scandir() iterator
* Set the source parameter when emitting the ResourceWarning warning
* Close the iterator before emitting the warning
2016-03-23 00:43:54 +01:00
Victor Stinner f664dc5834 ResourceWarning: Revert change on socket and scandir
io.FileIO has a safe implementation of destructor, but not socket nor scandir.
2016-03-19 02:01:48 +01:00
Victor Stinner 914cde89d4 On ResourceWarning, log traceback where the object was allocated
Issue #26567:

* Add a new function PyErr_ResourceWarning() function to pass the destroyed
  object
* Add a source attribute to warnings.WarningMessage
* Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where
  source object was allocated.
2016-03-19 01:03:51 +01:00
Victor Stinner c36674a2c5 Fix usage of PyMem_Malloc() in os.stat()
Issue #26563: Replace PyMem_Malloc() with PyMem_RawMalloc() in the Windows
implementation of os.stat(), since the code is called without holding the GIL.
2016-03-16 14:30:16 +01:00
Victor Stinner c44f70770b posix_getcwd(): limit to INT_MAX on Windows
It's more to fix a conversion warning during compilation, I don't think that
Windows support current working directory larger than 2 GB ...
2016-03-14 18:07:53 +01: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 fd625c39d0 Issue #26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
2016-02-08 17:57:22 +02:00
Serhiy Storchaka 988b9bcd88 Issue #26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
2016-02-08 17:56:36 +02:00
Serhiy Storchaka ef1585eb9a Issue #25923: Added more const qualifiers to signatures of static and private functions. 2015-12-25 20:01:53 +02:00
Serhiy Storchaka 2d06e84455 Issue #25923: Added the const qualifier to static constant arrays. 2015-12-25 19:53:18 +02:00
Serhiy Storchaka 8bc2b4d522 Issue #25890: Removed yet one unused variable. 2015-12-18 10:06:58 +02:00
Serhiy Storchaka 9b3a2eec1c Issues #25890, #25891, #25892: Removed unused variables in Windows code.
Reported by Alexander Riccio.
2015-12-18 10:03:13 +02:00
Victor Stinner 9fdaff30db Merge 3.5 2015-12-14 00:22:10 +01:00
Victor Stinner e847d7170d Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() (new try) 2015-12-14 00:21:50 +01:00
Victor Stinner 6b8f0c892a (Merge 3.5) Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() 2015-12-13 21:41:12 +01:00
Victor Stinner ed53782ed5 Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() 2015-12-13 21:40:26 +01:00
Victor Stinner 5ebae87628 Issue #25207, #14626: Fix my commit.
It doesn't work to use #define XXX defined(YYY)" and then "#ifdef XXX"
to check YYY.
2015-09-22 01:29:33 +02:00
Victor Stinner 4552ced916 Issue #25207, #14626: Fix ICC compiler warnings in posixmodule.c
Replace "#if XXX" with #ifdef XXX".
2015-09-21 22:37:15 +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
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