summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40653: Move _dirnameW out of GH-ifdef HAVE_SYMLINK/GH-endif (GH-20144)Miss Islington (bot)2020-05-181-2/+6
| | | | | (cherry picked from commit 7f21c9ac872acc2114aee3313d132b016550ff42) Co-authored-by: Minmin Gong <gongminmin@msn.com>
* bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)Miss Islington (bot)2020-04-221-1/+3
| | | | | | | | 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. (cherry picked from commit b07350901cac9197aef41855d8a4d56533636b91) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40014: Fix os.getgrouplist() (GH-19126)Miss Islington (bot)2020-03-241-22/+25
| | | | | | | | | | | Fix os.getgrouplist(): if getgrouplist() function fails because the group list is too small, retry with a larger group list. On failure, the glibc implementation of getgrouplist() sets ngroups to the total number of groups. For other implementations, double the group list size. (cherry picked from commit f5c7cabb2be4e42a5975ba8aac8bb458c8d9d6d7) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)Miss Islington (bot)2020-03-231-0/+19
| | | | | | | | On macOS, getgrouplist() returns a non-zero value without setting errno if the group list is too small. Double the list size and call it again in this case. (cherry picked from commit 8ec7370c89aa522602eb9604086ce9f09770953d) Co-authored-by: Victor Stinner <vstinner@python.org>
* closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. ↵Miss Islington (bot)2019-06-271-0/+3
| | | | | | | (GH-14414) (cherry picked from commit 45a30af109f69a81576b87ea775863ba12d55316) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)Miss Islington (bot)2019-06-131-15/+17
| | | | | (cherry picked from commit 8725c83ed5ca8959195ad8326db99d564a921749) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
* bpo-35942: Improve the error message if __fspath__ returns invalid types in ↵Miss Islington (bot)2019-02-181-8/+15
| | | | | | | | 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. (cherry picked from commit 09fbcd6085e18b534fd4161844ff39f77eb4a082) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.7] Remove stray quote in os.replace docstring. (GH-11835)Benjamin Peterson2019-02-131-2/+2
| | | | | (cherry picked from commit 73d600239b0aa34198bce2b7982e4ff14c92f119) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* bpo-29734: nt._getfinalpathname handle leak (GH-740)Miss Islington (bot)2019-02-021-8/+10
| | | | | | Make sure that failure paths call CloseHandle outside of the function that failed (cherry picked from commit b82bfac4369c0429e562a834b3752e66c4821eab) Co-authored-by: Mark Becwar <mark@thebecwar.com>
* [3.7] bpo-35214: Annotate posix calls for clang MSan. (GH-11389) (GH-11391)Gregory P. Smith2018-12-311-0/+13
| | | | | | | It doesn't know the details of a few less common libc functions.. (cherry picked from commit 1d300ce1d8238136595c8fea76266a4755cd73a2) Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
* bpo-35550: Fix incorrect Solaris define guards (GH-11275)Miss Islington (bot)2018-12-311-1/+1
| | | | | | | | | | Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used. Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_systemGH-Solaris https://bugs.python.org/issue35550 (cherry picked from commit 6f9bc72c79c3262e5d0f2c0e96b016477399cfb1) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* [3.7] bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in ↵Serhiy Storchaka2018-12-141-4/+5
| | | | | | AC. (GH-11150). (GH-11151) (cherry picked from commit afb3e71a1710c444fbe789b51df43ee16ee9ede7)
* bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz2018-12-071-4/+2
| | | | | (GH-11015) (GH-11020) (cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
* bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)Miss Islington (bot)2018-12-011-22/+15
| | | | | (cherry picked from commit 32bc11c33cf5ccea165b5f4ac3799f02fdf9c76a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)Miss Islington (bot)2018-11-221-5/+1
| | | | | | | | os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7648547ffb77144bf2480155f6d7940dea) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.7]bpo-29341: Backport b942707 3.7 (#10298)BNMetrics2018-11-021-20/+20
| | | | | | | Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted.. (cherry picked from commit b942707fc23454a998323c17e30be78ff1a4f0e7) Co-authored-by: BNMetrics <luna@bnmetrics.com>
* bpo-32890, os: Use errno instead of GetLastError() in execve() and ↵Miss Islington (bot)2018-10-201-3/+15
| | | | | | | | | | | | | 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. (cherry picked from commit 834603112e6ca35944dd21105b01fca562dc3241) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* bpo-31577: Fix a crash in os.utime() in case of a bad ns argument. (GH-3752)Miss Islington (bot)2018-09-121-0/+6
| | | | | (cherry picked from commit 0bd1a2dcfdf36b181385ae61361e7692f4ebb0fd) Co-authored-by: Oren Milman <orenmn@gmail.com>
* bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)Miss Islington (bot)2018-07-311-17/+20
| | | | | | | | | | | | | | * 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. (cherry picked from commit 9d5727326af53ddd91016d98e16ae7cf829caa95) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-20104: Remove posix_spawn from 3.7 (GH-6794)Pablo Galindo2018-05-141-224/+0
| | | Remove os.posix_spawn, the API isn't complete and we're still figuring out how it should look. wait for 3.8.
* bpo-20104: Improve error handling and fix a reference leak in ↵Miss Islington (bot)2018-05-011-122/+123
| | | | | | | os.posix_spawn(). (GH-6332) (cherry picked from commit ef347535f289baad22c0601e12a36b2dcd155c3a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname ↵Miss Islington (bot)2018-03-081-42/+32
| | | | | | | (GH-6010) (cherry picked from commit 3b20d3454e8082e07dba93617793de5dc9237828) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)Miss Islington (bot)2018-03-051-28/+38
| | | | | (cherry picked from commit 6921e73e33edc3c61bc2d78ed558eaa22a89a564) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5945)Miss Islington (bot)2018-03-011-7/+7
| | | | | (cherry picked from commit 3e197c7a6740d564ad52fb7901c07d5ff49460f5) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage ↵Miss Islington (bot)2018-02-221-33/+48
| | | | | | | now correctly convert from bytes. (GH-5761) (cherry picked from commit 23ad6d0d1a7a6145a01494f4f3913a63d1f0250c) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)Miss Islington (bot)2018-02-201-1/+1
| | | | | | | | | | | os.dup2() tests for dup3() system call availability at runtime, but doesn't remember the result across calls, repeating the test on each call with inheritable=False. Since the caller of os.dup2() is expected to hold the GIL, fix this by making the variable holding the test result static. (cherry picked from commit b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* Update comment in posixmodule.c (GH-5681)Miss Islington (bot)2018-02-141-1/+1
| | | | | | | | A closing parentheses was missing. Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com> (cherry picked from commit 7745ec4e356ac1f4eaf43b155f4482c20a907d48) Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
* bpo-29248: Fix os.readlink() on Windows (GH-5577)Miss Islington (bot)2018-02-121-3/+3
| | | | | | | The PrintNameOffset field of the reparse data buffer was treated as a number of characters instead of bytes. (cherry picked from commit 3c34aad4e7a95913ec7db8e5e948a8fc69047bf7) Co-authored-by: SSE4 <tomskside@gmail.com>
* bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 ↵Stéphane Wirtel2018-01-301-1/+1
| | | | | (GH-5346) See https://bugs.python.org/issue32441 for where this was introduced.
* bpo-20104: Fix leaks and errors in new os.posix_spawn (GH-5418)Pablo Galindo2018-01-291-52/+66
| | | | | | | | | | * Fix memory leaks and error handling in posix spawn * Improve error handling when destroying the file_actions object * Py_DECREF the result of PySequence_Fast on error * Handle uninitialized pid * Use OSError if file actions fails to initialize * Move _file_actions to outer scope to avoid undefined behaviour * Remove HAVE_POSIX_SPAWN define in Modules/posixmodule.c * Unshadow exception and clean error message
* bpo-32705: Current Android does not have posix_spawn (#5413)Chih-Hsuan Yen2018-01-291-0/+7
|
* bpo-20104: Expose `posix_spawn` in the os module (GH-5109)Pablo Galindo2018-01-291-1/+201
| | | | | Add os.posix_spawn to wrap the low level POSIX API of the same name. Contributed by Pablo Galindo.
* bpo-32659: Solaris "stat" should support "st_fstype" (#5307)jcea2018-01-281-0/+17
| | | | | | * bpo-32659: Solaris "stat" should support "st_fstype" * Add 'versionadded'
* bpo-31368: Expose preadv and pwritev in the os module (#5239)Pablo Galindo2018-01-271-0/+194
|
* bpo-32390: Fix compilation failure on AIX after f_fsid was added to ↵Michael Felt2018-01-051-0/+6
| | | | os.statvfs() (#4972)
* return the new file descriptor from os.dup2 (closes bpo-32441) (#5041)Benjamin Peterson2017-12-291-16/+27
|
* bpo-26439 Fix ctypes.util.find_library failure on AIX (#4507)Michael Felt2017-12-191-0/+3
| | | | | Implement find_library() support in ctypes/util for AIX. Add some AIX specific tests.
* bpo-32143: add f_fsid to os.statvfs() (#4571)Giuseppe Scrivano2017-12-141-0/+2
| | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (#4797)Anthony Sottile2017-12-141-0/+1
|
* bpo-16135: Cleanup: Code rot left over from OS/2 support (GH-4147)Erik Bray2017-10-271-5/+1
| | | | Remove dangling references to PYCC_VACPP that are not relelvant since removal of OS/2 support.
* bpo-30768: Recompute timeout on interrupted lock (GH-4103)Victor Stinner2017-10-241-3/+1
| | | | | | | | | | | | | | | | Fix the pthread+semaphore implementation of PyThread_acquire_lock_timed() when called with timeout > 0 and intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a signal (EINTR). See also the PEP 475. The pthread implementation of PyThread_acquire_lock() now fails with a fatal error if the timeout is larger than PY_TIMEOUT_MAX, as done in the Windows implementation. The check prevents any risk of overflow in PyThread_acquire_lock(). Add also PY_DWORD_MAX constant.
* bpo-31827: Remove os.stat_float_times() (GH-4061)Victor Stinner2017-10-241-44/+4
|
* os.startfile(): add a C comment on security (#3877)Victor Stinner2017-10-131-0/+4
| | | LoadLibrary("SHELL32") is not vulnerable to DLL hijacking.
* bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)Masayuki Yamamoto2017-10-061-3/+0
| | | | | | | | | See PEP 539 for details. Highlights of changes: - Add Thread Specific Storage (TSS) API - Document the Thread Local Storage (TLS) API as deprecated - Update code that used TLS API to use TSS API
* remove support for BSD/OS (closes bpo-31624) (#3812)Benjamin Peterson2017-09-291-1/+1
|
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-3/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31343: Include sys/sysmacros.h (#3318)Christian Heimes2017-09-051-0/+5
| | | | | | Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray plans to remove the functions from sys/types.h. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-30581: Windows: os.cpu_count() returns wrong number of processors (#2934)Christopher Wilcox2017-08-301-3/+16
| | | | | | | | * Fixes #30581 by adding a path to use newer GetMaximumProcessorCount API on Windows calls to os.cpu_count() * Add NEWS.d entry for bpo-30581, os.cpu_count on Windows. * Tweak NEWS entry
* bpo-31106: Fix handling of erros in posix_fallocate() and posix_fadvise() ↵Коренберг Марк2017-08-141-10/+20
| | | | (#3000) (#3000)
* Spelling fixes (#2902)Ville Skyttä2017-08-031-1/+1
|