| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(GH-11015) (GH-11020)
(cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
|
| |
|
|
|
| |
(cherry picked from commit 32bc11c33cf5ccea165b5f4ac3799f02fdf9c76a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
| |
(cherry picked from commit 0bd1a2dcfdf36b181385ae61361e7692f4ebb0fd)
Co-authored-by: Oren Milman <orenmn@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
| |
Remove os.posix_spawn, the API isn't complete and we're still figuring out how it should look. wait for 3.8.
|
| |
|
|
|
|
|
| |
os.posix_spawn(). (GH-6332)
(cherry picked from commit ef347535f289baad22c0601e12a36b2dcd155c3a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-6010)
(cherry picked from commit 3b20d3454e8082e07dba93617793de5dc9237828)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 6921e73e33edc3c61bc2d78ed558eaa22a89a564)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
| |
|
|
|
| |
(cherry picked from commit 3e197c7a6740d564ad52fb7901c07d5ff49460f5)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
now correctly convert from bytes. (GH-5761)
(cherry picked from commit 23ad6d0d1a7a6145a01494f4f3913a63d1f0250c)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
| |
(GH-5346)
See https://bugs.python.org/issue32441 for where this was introduced.
|
| |
|
|
|
|
|
|
|
|
| |
* 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
|
| | |
|
| |
|
|
|
| |
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"
* Add 'versionadded'
|
| | |
|
| |
|
|
| |
os.statvfs() (#4972)
|
| | |
|
| |
|
|
|
| |
Implement find_library() support in ctypes/util for AIX.
Add some AIX specific tests.
|
| |
|
| |
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
| | |
|
| |
|
|
| |
Remove dangling references to PYCC_VACPP that are not relelvant
since removal of OS/2 support.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
| |
LoadLibrary("SHELL32") is not vulnerable to DLL hijacking.
|
| |
|
|
|
|
|
|
|
| |
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 Setup.config
* Always define WITH_THREAD for compatibility.
|
| |
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
* 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
|
| |
|
|
| |
(#3000) (#3000)
|
| | |
|
| |
|
|
| |
called with bytes-like argument.
|
| |
|
|
|
|
|
| |
Based on patch by Victor Stinner.
Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters.
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
| |
in `os.putenv()` and `os.spawn*()`.
|
| |
|
|
| |
Fix a regression introduced by myself in the commit
526b22657cb18fe79118c2ea68511aca09430c2c.
|
| |
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
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
* 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).
* Use only the LongLong form for the conversions.
|
| |
|
|
|
|
| |
raised an error.
Replace them with using concrete types API that never fails if appropriate.
|