summaryrefslogtreecommitdiff
path: root/Modules/_io/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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-151-2/+2
| | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks.
* | | (Merge 3.3) Issue #16367: Fix FileIO.readall() on Windows for files larger ↵Victor Stinner2013-01-031-2/+11
|\ \ \ | |/ / | | | | | | than 2 GB.
| * | (Merge 3.2) Issue #16367: Fix FileIO.readall() on Windows for files larger ↵Victor Stinner2013-01-031-2/+11
| |\ \ | | |/ | | | | | | than 2 GB.
| | * Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GBVictor Stinner2013-01-031-2/+11
| | |
* | | Issue #15478: Raising an OSError doesn't decode or encode the filename anymoreVictor Stinner2012-10-301-6/+1
|/ / | | | | | | | | | | | | Pass the original filename argument to OSError constructor, instead of trying to encode it to or decode it from the filesystem encoding. This change avoids an additionnal UnicodeDecodeError on Windows if the filename cannot be decoded from the filesystem encoding (ANSI code page).
* | Issue #15247: FileIO now raises an error when given a file descriptor ↵Antoine Pitrou2012-07-061-12/+5
|\ \ | |/ | | | | pointing to a directory.
| * Issue #15247: FileIO now raises an error when given a file descriptor ↵Antoine Pitrou2012-07-061-12/+5
| | | | | | | | pointing to a directory.
* | Fixes issue #12268: File readline, readlines and read() or readall() methodsGregory P. Smith2012-06-241-0/+7
|\ \ | |/ | | | | | | | | no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
| * Fixes issue #12268: File readline, readlines and read() or readall() methodsGregory P. Smith2012-06-231-0/+7
| | | | | | | | | | | | no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
* | Simplify code in fileio_initHynek Schlawack2012-06-221-2/+1
| | | | | | | | | | | | If an identical code line is in both at the end of if and else, it can as well stand after the block. :) The code is from 464cf523485e, I didn't see it before checking the commits in the web interface of course.
* | #10053: Don't close FDs when FileIO.__init__ failsHynek Schlawack2012-06-211-6/+6
|\ \ | |/ | | | | Loosely based on the work by Hirokazu Yamamoto.
| * #10053: Don't close FDs when FileIO.__init__ failsHynek Schlawack2012-06-211-6/+5
| | | | | | | | Loosely based on the work by Hirokazu Yamamoto.
* | #4841: Fix FileIO constructor to honor closefd when called repeatedlyHynek Schlawack2012-05-251-3/+7
|\ \ | |/ | | | | Patch by Victor Stinner.
| * #4841: Fix FileIO constructor to honor closefd when called repeatedlyHynek Schlawack2012-05-251-3/+7
| | | | | | | | Patch by Victor Stinner.
* | Speed up reading of small files. This avoids multiple C read() calls on pyc ↵Antoine Pitrou2012-04-171-3/+11
| | | | | | | | files.
* | Issue #13848: open() and the FileIO constructor now check for NUL characters ↵Antoine Pitrou2012-01-291-21/+9
|\ \ | |/ | | | | | | | | in the file name. Patch by Hynek Schlawack.
| * Issue #13848: open() and the FileIO constructor now check for NUL characters ↵Antoine Pitrou2012-01-291-22/+11
| | | | | | | | | | | | in the file name. Patch by Hynek Schlawack.
* | Issue #12760: Refer to the new 'x' open mode as "exclusive creation" mode.Charles-François Natali2012-01-141-3/+3
| |
* | Issue #12760: Add a create mode to open(). Patch by David Townshend.Charles-François Natali2012-01-091-10/+28
| |
* | Issue #10350: Read and save errno before calling a function which might ↵Antoine Pitrou2011-12-161-3/+11
|\ \ | |/ | | | | | | | | overwrite it. Original patch by Hallvard B Furuseth.
| * Issue #10350: Read and save errno before calling a function which might ↵Antoine Pitrou2011-12-161-3/+11
| | | | | | | | | | | | overwrite it. Original patch by Hallvard B Furuseth.
* | Replace {Get,Set,Has}AttrString with *AttrId.Martin v. Löwis2011-10-141-1/+2
| |
* | Issue #12797: Added custom opener parameter to builtin open() and FileIO.open().Ross Lagerwall2011-10-311-12/+37
| |
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-1/+1
| |
* | Merge #13159: Replace FileIO's quadratic-time buffer growth algorithm with a ↵Nadeem Vawda2011-10-131-15/+4
|\ \ | |/ | | | | | | | | linear-time one. Also fix the bz2 module, which suffered from the same problem.
| * Issue #13159: Replace FileIO's quadratic-time buffer growth algorithm with a ↵Nadeem Vawda2011-10-131-15/+4
| | | | | | | | | | | | linear-time one. Also fix the bz2 module, whose classes used the same algorithm.
* | Fix FileIO.readall() (new_buffersize()) for large filesVictor Stinner2011-10-111-1/+5
| | | | | | | | Truncate the buffer size to PY_SSIZE_T_MAX.
* | Fix io.FileIO.readall() on Windows 64 bitsVictor Stinner2011-10-111-4/+4
| | | | | | | | Use Py_off_t type (64 bits) instead of off_t (32 bits).
* | Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-2/+3
| | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* | fileio_init() checks for failure on conversion to Py_UNICODE*Victor Stinner2011-09-291-4/+6
| |
* | (merge 3.2) Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX ↵Victor Stinner2011-07-051-0/+8
|\ \ | |/ | | | | on Windows.
| * Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.Victor Stinner2011-07-051-0/+8
| |
* | Issue #12175: FileIO.readall() now only reads the file position and size once.Victor Stinner2011-05-261-7/+30
|/
* (Merge 3.1) Issue #12175: FileIO.readall() now raises a ValueError instead ofVictor Stinner2011-05-251-0/+2
|\ | | | | | | an IOError if the file is closed.
| * Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError ifVictor Stinner2011-05-251-0/+2
| | | | | | | | the file is closed.
| * Merged revisions 85728,85731,85735,85766-85771,85773,85777 via svnmerge fromGeorg Brandl2010-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r85728 | georg.brandl | 2010-10-19 20:54:25 +0200 (Di, 19 Okt 2010) | 1 line #10092: Properly reset locale in Locale*Calendar classes. The context manager was buggy because setlocale() returns the *new* locale, not the old. Also add a test for this. ........ r85731 | georg.brandl | 2010-10-19 23:07:16 +0200 (Di, 19 Okt 2010) | 1 line Be consistent in the spelling of thread-safe(ty). ........ r85735 | georg.brandl | 2010-10-20 08:50:19 +0200 (Mi, 20 Okt 2010) | 1 line Fix r85728: use "" to mean the system default locale, which should work on more systems. ........ r85766 | georg.brandl | 2010-10-21 09:40:03 +0200 (Do, 21 Okt 2010) | 1 line #10159: sort completion matches before comparing to dir() result. ........ r85767 | georg.brandl | 2010-10-21 14:49:28 +0200 (Do, 21 Okt 2010) | 1 line #9095, #8912, #8999: add support in patchcheck for Mercurial checkouts, C file reindenting, and docs whitespace fixing. ........ r85768 | georg.brandl | 2010-10-21 14:59:14 +0200 (Do, 21 Okt 2010) | 1 line #9919: fix off-by-one error in lineno command in Misc/gdbinit; also add newline to its output. ........ r85769 | georg.brandl | 2010-10-21 15:01:23 +0200 (Do, 21 Okt 2010) | 1 line Fix missing import. ........ r85770 | georg.brandl | 2010-10-21 15:29:10 +0200 (Do, 21 Okt 2010) | 1 line #3077: fix h2py substitution of character literals. ........ r85771 | georg.brandl | 2010-10-21 15:34:51 +0200 (Do, 21 Okt 2010) | 1 line #1203650: allow larger list of files in windows makefile for freeze. ........ r85773 | georg.brandl | 2010-10-21 15:45:52 +0200 (Do, 21 Okt 2010) | 1 line #4829: better error message for invalid file mode ........ r85777 | georg.brandl | 2010-10-21 17:44:51 +0200 (Do, 21 Okt 2010) | 1 line Add .hgeol file for the Mercurial EOL extension. ........
| * Merged revisions 85982 via svnmerge fromAntoine Pitrou2010-10-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85982 | antoine.pitrou | 2010-10-30 18:19:14 +0200 (sam., 30 oct. 2010) | 4 lines Issue #10253: FileIO leaks a file descriptor when trying to open a file for append that isn't seekable. Patch by Brian Brazil. ........
| * Merged revisions 80798 via svnmerge fromAntoine Pitrou2010-05-051-703/+703
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80798 | antoine.pitrou | 2010-05-05 18:31:07 +0200 (mer., 05 mai 2010) | 9 lines Merged revisions 80796 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80796 | antoine.pitrou | 2010-05-05 18:27:30 +0200 (mer., 05 mai 2010) | 3 lines Untabify Modules/_io/fileio.c ........ ................
| * Merged revisions 77895-77896 via svnmerge fromAntoine Pitrou2010-01-311-20/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77895 | antoine.pitrou | 2010-01-31 23:47:27 +0100 (dim., 31 janv. 2010) | 12 lines Merged revisions 77890 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77890 | antoine.pitrou | 2010-01-31 23:26:04 +0100 (dim., 31 janv. 2010) | 7 lines - Issue #6939: Fix file I/O objects in the `io` module to keep the original file position when calling `truncate()`. It would previously change the file position to the given argument, which goes against the tradition of ftruncate() and other truncation APIs. Patch by Pascal Chambon. ........ ................ r77896 | antoine.pitrou | 2010-02-01 00:12:29 +0100 (lun., 01 févr. 2010) | 3 lines r77895 broke doctest. ................
| * Merged revisions 77781-77782 via svnmerge fromBenjamin Peterson2010-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r77781 | benjamin.peterson | 2010-01-26 19:47:14 -0600 (Tue, 26 Jan 2010) | 1 line don't accept bytes in FileIO.write #7785 ........ r77782 | benjamin.peterson | 2010-01-26 19:51:29 -0600 (Tue, 26 Jan 2010) | 1 line add issue number ........
| * Merged revisions 76806,76808 via svnmerge fromBenjamin Peterson2009-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r76806 | benjamin.peterson | 2009-12-13 13:25:34 -0600 (Sun, 13 Dec 2009) | 14 lines Merged revisions 76805 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76805 | benjamin.peterson | 2009-12-13 13:19:07 -0600 (Sun, 13 Dec 2009) | 7 lines accept None as the same as having passed no argument in file types #7349 This is for consistency with imitation file objects like StringIO and BytesIO. This commit also adds a few tests, where they were lacking for concerned methods. ........ ................ r76808 | benjamin.peterson | 2009-12-13 13:28:09 -0600 (Sun, 13 Dec 2009) | 9 lines Merged revisions 76807 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76807 | benjamin.peterson | 2009-12-13 13:27:02 -0600 (Sun, 13 Dec 2009) | 1 line remove unused variable ........ ................
| * Merged revisions 75009 via svnmerge fromAntoine Pitrou2009-09-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75009 | antoine.pitrou | 2009-09-21 23:37:02 +0200 (lun., 21 sept. 2009) | 13 lines Merged revisions 75007 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75007 | antoine.pitrou | 2009-09-21 23:17:48 +0200 (lun., 21 sept. 2009) | 7 lines Issue #6236, #6348: Fix various failures in the io module under AIX and other platforms, when using a non-gcc compiler. Patch by egreen. In addition, I made explicit the signedness of all bitfields in the IO library. ........ ................
* | Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes onVictor Stinner2011-03-201-1/+8
| | | | | | | | | | | | | | Windows if the file is a TTY to workaround a Windows bug. The Windows console returns an error (12: not enough space error) on writing into stdout if stdout mode is binary and the length is greater than 66,000 bytes (or less, depending on heap usage).
* | Issue #9611: remove useless and dangerous explicit conversion to size_tVictor Stinner2011-01-111-2/+2
| |
* | Issue #10841: set binary mode on files; the parser translates newlinesVictor Stinner2011-01-071-0/+5
| | | | | | | | | | | | On Windows, set the binary mode on stdin, stdout, stderr and all io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser translates newlines (\r\n => \n).
* | Issue #9015, #9611: FileIO.readinto(), FileIO.write() and os.write() clamp theVictor Stinner2011-01-041-4/+18
| | | | | | | | length to 2^31-1 on Windows.
* | Issue #10180: Pickling file objects is now explicitly forbidden, sinceAntoine Pitrou2010-11-051-0/+9
| | | | | | | | unpickling them produced nonsensical results.
* | if FileIO.__init__ fails, close fdBenjamin Peterson2010-10-301-0/+2
| |
* | fix styleBenjamin Peterson2010-10-301-1/+1
| |