summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* bpo-30879: os.listdir() and os.scandir() now emit bytes names when (#2634)Serhiy Storchaka2017-07-111-3/+5
| | | | called with bytes-like argument.
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-281-6/+12
| | | | | | | Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
* bpo-30769: Fix reference leak introduced in 77703942c59 (#2416)Eric N. Vander Weele2017-06-271-0/+4
| | | | | | | New error condition paths were introduced, which did not decrement `key2` and `val2` objects. Therefore, decrement references before jumping to the error label. Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
* bpo-30746: Prohibited the '=' character in environment variable names (#2382)Serhiy Storchaka2017-06-251-4/+28
| | | | in `os.putenv()` and `os.spawn*()`.
* bpo-30602: Fix lastarg in os.spawnve() (#2287)Victor Stinner2017-06-231-3/+3
| | | | Fix a regression introduced by myself in the commit 526b22657cb18fe79118c2ea68511aca09430c2c.
* bpo-30602: Fix refleak in os.spawnv() (#2212)Victor Stinner2017-06-151-1/+1
| | | | | When os.spawnv() fails while handling arguments, free correctly argvlist: pass lastarg+1 rather than lastarg to free_string_array() to also free the first item.
* bpo-30602: Fix refleak in os.spawnve() (#2184)Victor Stinner2017-06-141-2/+2
| | | | | When os.spawnve() fails while handling arguments, free correctly argvlist: pass lastarg+1 rather than lastarg to free_string_array() to also free the first item.
* bpo-30650: Fixed a syntax error: missed right parentheses (#2154)messi Liao2017-06-131-1/+1
|
* bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834)Gregory P. Smith2017-05-291-27/+44
| | | | Instead use keyword only arguments to os.register_at_fork for each of the scenarios. Updates the documentation for clarity.
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-30/+154
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666).xdegaye2017-05-221-18/+5
| | | | | | bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666). * Use only the LongLong form for the conversions.
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-18/+42
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.