summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* 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().
* | Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-301-5/+19
| |
* | Issue #18408: Fix fileio_read() on _PyBytes_Resize() failureVictor Stinner2013-07-161-1/+1
| | | | | | | | bytes is NULL on _PyBytes_Resize() failure
* | If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.Victor Stinner2013-06-241-7/+7
| |
* | Check for correct macro, code uses S_ISDIR().Christian Heimes2013-06-231-1/+1
|\ \ | |/
| * Check for correct macro, code uses S_ISDIR().Christian Heimes2013-06-231-1/+1
| |
| * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-2/+2
| |\ | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
| | * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-1/+1
| | | | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
* | | FileIO.readall(): remove trailing space from an exception messageVictor Stinner2013-05-171-1/+1
| | |
* | | Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity.Richard Oudkerk2013-05-171-66/+52
| | |
* | | Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-141-2/+2
| | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks.