summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36346: Make using the legacy Unicode C API optional (GH-21437)Serhiy Storchaka2020-07-101-0/+12
| | | | Add compile time option USE_UNICODE_WCHAR_CACHE. Setting it to 0 makes the interpreter not using the wchar_t cache and the legacy Unicode C API.
* bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)Serhiy Storchaka2020-05-261-10/+0
| | | | Only __index__ should be used to make integer conversions lossless.
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+1
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. ↵Benjamin Peterson2019-11-121-9/+15
| | | | | (GH-17112) This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode.
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-141-3/+3
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)Jeroen Demeyer2019-07-111-2/+2
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-32388: Remove cross-version binary compatibility requirement in tp_flags ↵Antoine Pitrou2019-05-291-3/+3
| | | | | | | | (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-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-0/+4
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-0/+1
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-33138: Change standard error message for non-pickleable and non-copyable ↵Serhiy Storchaka2018-10-311-9/+0
| | | | types. (GH-6239)
* bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705)Stéphane Wirtel2018-10-171-5/+3
| | | On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-1/+1
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-251-5/+3
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* bpo-32186: Release the GIL during lseek and fstat (#4652)Nir Soffer2017-12-011-1/+5
| | | | | | In _io_FileIO_readall_impl(), lseek() and _Py_fstat_noraise() were called without releasing the GIL. This can cause all threads to hang for unlimited time when calling FileIO.read() and the NFS server is not accessible.
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-1/+1
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-281-2/+1
| | | | | | | 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-30228: FileIO seek() and tell() set seekable (#1384)Victor Stinner2017-05-021-15/+21
| | | | | | | FileIO.seek() and FileIO.tell() method now set the internal seekable attribute to avoid one syscall on open() (in buffered or text mode). The seekable property is now also more reliable since its value is set correctly on memory allocation failure.
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-4/+4
|
* bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)Serhiy Storchaka2017-03-301-9/+2
| | | if pass `accept={int, NoneType}`.
* bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. (#514)Serhiy Storchaka2017-03-191-3/+13
|
* bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka2017-03-121-2/+2
|
* Merge issue #28164 and issue #29409Steve Dower2017-02-041-17/+14
|\
| * Issue #29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun)Steve Dower2017-02-041-17/+14
| |
* | Issue #28768: Fix implicit declaration of function _setmode. Patch by ↵Steve Dower2016-12-281-0/+3
|\ \ | |/ | | | | Masayuki Yamamoto
| * Issue #28768: Fix implicit declaration of function _setmode. Patch by ↵Steve Dower2016-12-281-0/+3
| | | | | | | | Masayuki Yamamoto
* | Use _PyObject_CallMethodIdObjArgs() in _ioVictor Stinner2016-12-091-2/+2
|/ | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
* Issue #23524: Finish removing _PyVerify_fd from sourcesSteve Dower2016-09-081-26/+13
|
* Issue #27066: Fixed SystemError if a custom opener (for open()) returns aBarry Warsaw2016-06-081-1/+7
|\ | | | | | | negative number without setting an exception.
| * Issue #27066: Fixed SystemError if a custom opener (for open()) returnsBarry Warsaw2016-06-081-1/+6
| | | | | | | | a negative number without setting an exception.
* | Issue #20699: Merge io bytes-like fixes from 3.5Martin Panter2016-05-281-2/+2
|\ \ | |/
| * Issue #20699: Document that “io” methods accept bytes-like objectsMartin Panter2016-05-281-2/+2
| | | | | | | | | | | | | | | | This matches the usage of ZipFile and BufferedWriter. This still requires return values to be bytes() objects. Also document and test that the write() methods should only access their argument before they return.
* | On ResourceWarning, log traceback where the object was allocatedVictor Stinner2016-03-191-2/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-2/+2
|/ | | | private functions.
* Issue #25717: Add comment explaining why errors are ignoredMartin Panter2015-12-061-0/+3
|
* Issue #25717: Tolerate fstat() failures in the FileIO constructorMartin Panter2015-12-061-12/+27
| | | | | | This restores 3.4 behaviour, which was removed by revision 3b5279b5bfd1. The fstat() call fails with ENOENT for a Virtual Box shared folder filesystem if the file entry has been unlinked, e.g. for a temporary file.
* Issue #24001: Argument Clinic converters now use accept={type}Larry Hastings2015-05-041-2/+2
| | | | instead of types={'type'} to specify the types the converter accepts.
* Issue #23908: os functions now reject paths with embedded null characterSerhiy Storchaka2015-04-201-7/+6
|\ | | | | | | | | | | on Windows instead of silently truncate them. Removed no longer used _PyUnicode_HasNULChars().
| * Issue #23908: os functions now reject paths with embedded null characterSerhiy Storchaka2015-04-201-7/+6
| | | | | | | | on Windows instead of silently truncate them.
* | Fix typo in assert statementChristian Heimes2015-04-161-1/+1
| |
* | Issue #20175: Converted the _io module to Argument Clinic.Serhiy Storchaka2015-04-161-157/+202
| |
* | Issue #23668: Suppresses invalid parameter handler around chsize calls.Steve Dower2015-04-121-0/+2
| |
* | Issue #23524: Replace _PyVerify_fd function with calls to ↵Steve Dower2015-04-121-1/+13
| | | | | | | | _set_thread_local_invalid_parameter_handler.
* | Issue #23668: Adds support for os.truncate and os.ftruncate on WindowsSteve Dower2015-03-211-50/+4
| |
* | Issue #21859: Corrected FileIO docstrings.Serhiy Storchaka2015-04-101-15/+18
|\ \ | |/
| * Issue #21859: Corrected FileIO docstrings.Serhiy Storchaka2015-04-101-15/+18
| |
* | Replaced "string" with "bytes object" in docstrings of binary I/O objects.Serhiy Storchaka2015-04-091-3/+3
|\ \ | |/
| * Replaced "string" with "bytes object" in docstrings of binary I/O objects.Serhiy Storchaka2015-04-091-3/+3
| |
* | Issue #23752: _Py_fstat() is now responsible to raise the Python exceptionVictor Stinner2015-03-301-6/+4
| | | | | | | | Add _Py_fstat_noraise() function when a Python exception is not welcome.
* | Issue #23752: When built from an existing file descriptor, io.FileIO() now onlyVictor Stinner2015-03-301-24/+0
| | | | | | | | calls fstat() once. Before fstat() was called twice, which was not necessary.