summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32186: Release the GIL during lseek and fstat (GH-4652) (#4661)Miss Islington (bot)2017-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. (cherry picked from commit 6a89481680b921e7b317c29877bdda9a6031e5ad)
* [3.6] bpo-13617: Reject embedded null characters in wchar* strings. ↵Serhiy Storchaka2017-06-281-2/+1
| | | | | | | | | | (GH-2302) (#2462) Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.. (cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
* bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. ↵Serhiy Storchaka2017-03-191-3/+13
| | | | | (#514) (#722) (cherry picked from commit a5af6e1af77ee0f9294c5776478a9c24d9fbab94)
* 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 #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.
* | Issue #23753: Python doesn't support anymore platforms without stat() orVictor Stinner2015-03-241-20/+0
| | | | | | | | | | | | | | fstat(), these functions are always required. Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and DONT_HAVE_FSTAT.
* | Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handleVictor Stinner2015-03-191-111/+31
| | | | | | | | | | | | | | | | EINTR error and special cases for Windows. These functions now truncate the length to PY_SSIZE_T_MAX to have a portable and reliable behaviour. For example, read() result is undefined if counter is greater than PY_SSIZE_T_MAX on Linux.
* | Issue #23524: Change back to using Windows errors for _Py_fstat instead of ↵Steve Dower2015-03-081-1/+7
| | | | | | | | the errno shim.
* | Issue #23524: Replace _PyVerify_fd function with calling ↵Steve Dower2015-03-061-1/+1
| | | | | | | | _set_thread_local_invalid_parameter_handler on every thread.
* | Issue #23285: Fix handling of EINTR in fileio.cVictor Stinner2015-03-041-28/+46
| | | | | | | | | | | | | | Fix handling of EINTR: don't return None if PyErr_CheckSignals() raised an exception. Initialize also the length outside the loop to only initialize it once.
* | Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on ↵Steve Dower2015-02-211-22/+24
| | | | | | | | | | | | Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
* | Issue #5700: io.FileIO() called flush() after closing the file.Serhiy Storchaka2015-02-201-7/+14
|\ \ | |/ | | | | flush() was not called in close() if closefd=False.
| * Issue #5700: io.FileIO() called flush() after closing the file.Serhiy Storchaka2015-02-201-7/+14
| | | | | | | | flush() was not called in close() if closefd=False.
* | Issue #23285: PEP 475 -- Retry system calls failing with EINTR.Charles-François Natali2015-02-071-55/+70
| |
* | Issue #17401: Output the closefd attribute as boolean.Serhiy Storchaka2014-12-021-4/+4
| |
* | Issue #17401: document closefd in io.FileIO docs and add to reprRobert Collins2014-10-181-4/+6
| | | | | | | | | | | | | | | | | | | | closefd was documented in the open docs but not the matching FileIO class documented. Further, closefd, part of the core state for the object was not shown. In review it was noted that the open docs are a little confusing about the interaction between closefd and paths, so tweaked them at the same time.
* | Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.Berker Peksag2014-09-241-3/+5
|\ \ | |/ | | | | Patch by Terry Chia.
| * Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.Berker Peksag2014-09-241-3/+5
| | | | | | | | Patch by Terry Chia.
* | Issue #22215: Now ValueError is raised instead of TypeError when str or bytesSerhiy Storchaka2014-09-061-1/+1
| | | | | | | | argument contains not permitted null character or byte.
* | (Merge 3.4) Issue #21090: io.FileIO.readall() does not ignore I/O errorsVictor Stinner2014-07-021-2/+2
|\ \ | |/ | | | | | | anymore. Before, it ignored I/O errors if at least the first C call read() succeed.
| * Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,Victor Stinner2014-07-021-2/+2
| | | | | | | | it ignored I/O errors if at least the first C call read() succeed.
* | Issue #21679: Prevent extraneous fstat() calls during open(). Patch by ↵Antoine Pitrou2014-06-301-21/+25
|/ | | | Bohuslav Kabrda.
* Issue #20037: Avoid crashes when doing text I/O late at interpreter shutdown.Antoine Pitrou2013-12-211-2/+4
|
* Issue #19512: fileio_init() reuses PyId_name identifier instead of "name"Victor Stinner2013-11-061-2/+3
| | | | literal string
* Issue #18876: The FileIO.mode attribute now better reflects the actual mode ↵Antoine Pitrou2013-09-041-9/+13
|\ | | | | | | | | | | under which the file was opened. Patch by Erik Bray.
| * Issue #18876: The FileIO.mode attribute now better reflects the actual mode ↵Antoine Pitrou2013-09-041-10/+13
| | | | | | | | | | | | under which the file was opened. Patch by Erik Bray.
* | Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-271-3/+29
| | | | | | | | | | are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().