summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37834: Normalise handling of reparse points on Windows (GH-15231)Steve Dower2019-08-211-181/+206
| | | | | | | | | | 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)
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* bpo-37493: use _PyObject_CallNoArg in more places (GH-14575)Jeroen Demeyer2019-07-041-1/+1
|
* bpo-37412: Fix os.getcwd() for long path on Windows (GH-14424)Victor Stinner2019-06-281-1/+1
| | | | * Fix test for integer overflow. * Add an unit test.
* closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. ↵Brandt Bucher2019-06-271-0/+3
| | | | (GH-14414)
* bpo-37419: Fix possible segfaults when passing large sequences to ↵Zackery Spytz2019-06-261-1/+1
| | | | | os.posix_spawn() (GH-14409) Use Py_ssize_t instead of int for i.
* bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)Victor Stinner2019-06-261-59/+64
| | | | | | | | | 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.
* bpo-20443: _PyConfig_Read() gets the absolute path of run_filename (GH-14053)Victor Stinner2019-06-251-21/+17
| | | | | | | | | | | | Python now gets the absolute path of the script filename specified on the command line (ex: "python3 script.py"): the __file__ attribute of the __main__ module, sys.argv[0] and sys.path[0] become an absolute path, rather than a relative path. * Add _Py_isabs() and _Py_abspath() functions. * _PyConfig_Read() now tries to get the absolute path of run_filename, but keeps the relative path if _Py_abspath() fails. * Reimplement os._getfullpathname() using _Py_abspath(). * Use _Py_isabs() in getpath.c.
* bpo-37363: Add audit events for a range of modules (GH-14301)Steve Dower2019-06-241-0/+9
|
* bpo-35134: Add Include/cpython/import.h header file (GH-14213)Victor Stinner2019-06-181-0/+1
| | | | | | * Add Include/cpython/import.h and Include/internal/pycore_import.h header files. * Move _PyImport_ReInitLock() to the internal C API. Don't export the symbol anymore.
* bpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)Jeffrey Kintscher2019-06-131-15/+17
|
* bpo-26826: Expose copy_file_range in the os module (GH-7255)Pablo Galindo2019-05-311-0/+71
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-4/+4
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)Zackery Spytz2019-05-291-0/+28
| | | https://bugs.python.org/issue26836
* bpo-32388: Remove cross-version binary compatibility requirement in tp_flags ↵Antoine Pitrou2019-05-291-2/+1
| | | | | | | | (GH-4944) It is now allowed to add new fields at the end of the PyTypeObject struct without having to allocate a dedicated compatibility flag in tp_flags. This will reduce the risk of running out of bits in the 32-bit tp_flags value.
* bpo-26836: Add os.memfd_create() (#13567)Zackery Spytz2019-05-291-0/+64
| | | | | | | | | | | | | | | | | | | | * 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.
* bpo-37031: Fix PyOS_AfterFork_Child() (GH-13537)Victor Stinner2019-05-241-1/+1
| | | | | | | PyOS_AfterFork_Child(): _PyInterpreterState_DeleteExceptMain() must be called after _PyRuntimeState_ReInitThreads(). _PyRuntimeState_ReInitThreads() resets interpreters mutex after fork, mutex used by _PyInterpreterState_DeleteExceptMain().
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+22
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-31904: Add posix module support for VxWorks (GH-12118)pxinwr2019-05-211-7/+65
|
* bpo-36728: Remove PyEval_ReInitThreads() from C API (GH-13241)Victor Stinner2019-05-131-4/+15
| | | | | | | | Remove the PyEval_ReInitThreads() function from the Python C API. It should not be called explicitly: use PyOS_AfterFork_Child() instead. Rename PyEval_ReInitThreads() to _PyEval_ReInitThreads() and add a 'runtime' parameter.
* bpo-36814: ensure os.posix_spawn() handles None (GH-13144)Anthony Shaw2019-05-101-1/+1
| | | | Fix an issue where os.posix_spawn() would incorrectly raise a TypeError when file_actions is None.
* Suppress clang warning (GH-12384)Rémi Lapeyre2019-05-031-1/+2
|
* bpo-36710: PyOS_AfterFork_Child() pass runtime parameter (GH-12936)Victor Stinner2019-04-241-3/+4
| | | | | | | | | The PyOS_AfterFork_Child() function now pass a 'runtime' parameter to subfunctions. * Fix _PyRuntimeState_ReInitThreads(): use the correct memory allocator * Add runtime parameter to _PyRuntimeState_ReInitThreads(), _PyGILState_Reinit() and _PyInterpreterState_DeleteExceptMain() * Move _PyGILState_Reinit() to the internal C API.
* bpo-31512: Add non-elevated symlink support for Windows (GH-3652)Vidar Tonaas Fauske2019-04-091-71/+39
|
* bpo-36085: Enable better DLL resolution on Windows (GH-12302)Steve Dower2019-03-291-4/+129
|
* bpo-33608: Make sure locks in the runtime are properly re-created. (gh-12245)Eric Snow2019-03-091-0/+1
|
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-0/+3
|
* bpo-35942: Improve the error message if __fspath__ returns invalid types in ↵Pablo Galindo2019-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.
* Remove stray quote in os.replace docstring. (GH-11556)Anthony Sottile2019-02-131-2/+2
|
* bpo-29734: nt._getfinalpathname handle leak (GH-740)Mark Becwar2019-02-021-8/+10
| | | Make sure that failure paths call CloseHandle outside of the function that failed
* bpo-33895: Relase GIL while calling functions that acquire Windows loader ↵Tony Roberts2019-02-021-3/+8
| | | | | lock (GH-7789) LoadLibrary, GetProcAddress, FreeLibrary and GetModuleHandle acquire the system loader lock. Calling these while holding the GIL will cause a deadlock on the rare occasion that another thread is detaching and needs to destroy its thread state at the same time.
* bpo-35537: Fix function name in os.posix_spawnp() errors (GH-11719)Victor Stinner2019-02-011-11/+13
|
* bpo-35537: Add setsid parameter to os.posix_spawn() and os.posix_spawnp() ↵Joannah Nanjekye2019-02-011-13/+31
| | | | (GH-11608)
* bpo-35674: Add os.posix_spawnp() (GH-11554)Joannah Nanjekye2019-01-161-34/+101
| | | Add a new os.posix_spawnp() function.
* bpo-35214: Annotate posix calls for clang MSan. (#11389)Gregory P. Smith2018-12-311-0/+16
| | | It doesn't know the details of a few less common libc functions.
* bpo-35550: Fix incorrect Solaris define guards (GH-11275)Jakub Kulík2018-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_system#Solaris https://bugs.python.org/issue35550
* bpo-35490: Remove the DecodeFSDefault return converter in AC. (#11152)Serhiy Storchaka2018-12-171-6/+7
|
* bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. ↵Serhiy Storchaka2018-12-141-4/+5
| | | | (GH-11150)
* bpo-35445: Do not ignore memory errors when create posix.environ. (GH-11049)Serhiy Storchaka2018-12-101-37/+27
|
* bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz2018-12-071-4/+2
| | | | | | (GH-11015) Set MemoryError when appropriate, add missing failure checks, and fix some potential leaks.
* bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)Serhiy Storchaka2018-12-011-22/+15
|
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-1/+1
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)Victor Stinner2018-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).
* bpo-34784: Fix PyStructSequence_NewType with heap-allocated StructSequence ↵Eddie Elizondo2018-11-131-41/+53
| | | | (GH-9665)
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-1/+1
| | | | | | | | | | | | | | Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
* bpo-29341: Clarify that path-like objects are accepted in some os methods ↵BNMetrics2018-11-021-20/+20
| | | | | (GH-10101) 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.
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
* bpo-32890, os: Use errno instead of GetLastError() in execve() and ↵Alexey Izbyshev2018-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.
* closes bpo-34862: Guard definition of convert_sched_param with ↵William Orr2018-10-021-4/+6
| | | | | | POSIX_SPAWN_SETSCHEDULER. (GH-9658) Fixes broken build on OpenBSD-current.
* bpo-32557: allow shutil.disk_usage to take a file path on Windows also (GH-9372)Joe Pamer2018-09-251-2/+27
| | | https://bugs.python.org/issue32557