summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GBVictor Stinner2013-01-031-2/+11
|
* 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.
* #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.
* 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 #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 #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.
* Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.Victor Stinner2011-07-051-0/+8
|
* (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
| |
* | Issue #10253: FileIO leaks a file descriptor when trying to open a fileAntoine Pitrou2010-10-301-1/+6
| | | | | | | | for append that isn't seekable. Patch by Brian Brazil.
* | Issue #10093: ResourceWarnings are now issued when files and sockets areAntoine Pitrou2010-10-291-0/+31
| | | | | | | | | | deallocated without explicit closing. These warnings are silenced by default, except in pydebug mode.
* | #4829: better error message for invalid file modeGeorg Brandl2010-10-211-1/+2
| |
* | Issue #9293: I/O streams now raise `io.UnsupportedOperation` when anAntoine Pitrou2010-09-051-1/+2
| | | | | | | | | | unsupported operation is attempted (for example, writing to a file open only for reading).
* | Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a UnicodeVictor Stinner2010-05-151-2/+1
| | | | | | | | | | | | object to Py_FileSystemDefaultEncoding with the "surrogateescape" error handler, return a bytes object. If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
* | Merged revisions 80796 via svnmerge fromAntoine Pitrou2010-05-051-700/+700
| | | | | | | | | | | | | | | | | | | | 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 ↵Benjamin Peterson2010-03-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 78338,78345-78346,78561-78562,78566,78574,78581,78634,78660,78675 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78338 | andrew.kuchling | 2010-02-22 15:04:02 -0600 (Mon, 22 Feb 2010) | 4 lines Remove Tools/modulator, a reference to it in the docs, and a screenshot of it. (I asked the BDFL first, and he approved removing it. The last actual bugfix to Tools/modulator was in 2001; since then all changes have been search-and-replace: string methods, whitespace fixes, etc.) ........ r78345 | andrew.kuchling | 2010-02-22 17:10:52 -0600 (Mon, 22 Feb 2010) | 1 line #7706: DONT_HAVE_ERRNO_H is no longer defined by configure (after rev.46819). ........ r78346 | andrew.kuchling | 2010-02-22 17:12:00 -0600 (Mon, 22 Feb 2010) | 1 line #7706: add include guards where they're missing; required for Windows CE ........ r78561 | andrew.kuchling | 2010-03-01 13:51:43 -0600 (Mon, 01 Mar 2010) | 1 line #7191: describe more details of wbits parameter ........ r78562 | andrew.kuchling | 2010-03-01 14:11:57 -0600 (Mon, 01 Mar 2010) | 1 line #7637: avoid repeated-concatenation antipattern in example ........ r78566 | barry.warsaw | 2010-03-01 15:46:51 -0600 (Mon, 01 Mar 2010) | 4 lines Manually copy patch for bug 7250 from the release26-maint branch. I suck because I did this in the wrong order and couldn't smack svnmerge into submission. ........ r78574 | benjamin.peterson | 2010-03-01 17:25:13 -0600 (Mon, 01 Mar 2010) | 1 line remove CVS id ........ r78581 | michael.foord | 2010-03-02 08:22:15 -0600 (Tue, 02 Mar 2010) | 1 line Link correction in documentation. ........ r78634 | benjamin.peterson | 2010-03-03 15:28:25 -0600 (Wed, 03 Mar 2010) | 1 line rephrase ........ r78660 | dirkjan.ochtman | 2010-03-04 13:21:53 -0600 (Thu, 04 Mar 2010) | 4 lines Try to fix buildbot breakage from r78384. Thanks bitdancer and briancurtin for the help. ........ r78675 | florent.xicluna | 2010-03-04 19:12:14 -0600 (Thu, 04 Mar 2010) | 2 lines These line should not be there. ........
* | Merged revisions 77890 via svnmerge fromAntoine Pitrou2010-01-311-20/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* | don't accept bytes in FileIO.write #7785Benjamin Peterson2010-01-271-1/+1
| |
* | Merged revisions 76805 via svnmerge fromBenjamin Peterson2009-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* | Merged revisions 75007 via svnmerge fromAntoine Pitrou2009-09-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* | Merged revisions 73603 via svnmerge fromHirokazu Yamamoto2009-06-281-5/+2
|/ | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73603 | hirokazu.yamamoto | 2009-06-28 19:23:00 +0900 | 1 line Issue #4856: Remove checks for win NT. ........
* move to a naming scheme with all lowercase and underscoresBenjamin Peterson2009-06-121-32/+32
|
* Issue #5761: Add the name of the underlying file to the repr() of various IO ↵Antoine Pitrou2009-05-231-3/+18
| | | | objects.
* Merged revisions 72698-72699 via svnmerge fromHirokazu Yamamoto2009-05-171-1/+1
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72698 | hirokazu.yamamoto | 2009-05-17 11:52:09 +0900 | 1 line Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. ........ r72699 | hirokazu.yamamoto | 2009-05-17 11:58:36 +0900 | 1 line Added NEWS for r72698. ........
* Silence a compiler warning.Raymond Hettinger2009-05-151-1/+1
|
* Rename utf8b error handler to surrogateescape.Martin v. Löwis2009-05-101-1/+1
|
* Issue #5915: Implement PEP 383, Non-decodable Bytes inMartin v. Löwis2009-05-051-1/+1
| | | | System Character Interfaces.
* use NULL for the ends of tablesBenjamin Peterson2009-04-191-1/+1
|
* Issue 5682: Move _io module into its own subdirectory.Alexandre Vassalotti2009-04-041-0/+1034
Reviewed by: Antoine Pitrou