summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22517: When a io.BufferedRWPair object is deallocated, clear itsGeorg Brandl2014-09-301-0/+6
| | | | weakrefs.
* #17275: Fix class name in init errors in C bufferedio classes.R David Murray2013-02-241-0/+18
| | | | | | This fixes an apparent copy-and-paste error. Patch by Manuel Jacob.
* Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlyingSerhiy Storchaka2013-02-031-0/+24
| | | | | stream or a decoder produces data of an unexpected type (i.e. when io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
* Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-0/+9
| | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
* Also add tests for TextIOWrapper.writelines() (issue #15744).Antoine Pitrou2012-10-161-0/+22
|
* Add tests for the writelines() method of file objects.Antoine Pitrou2012-10-161-1/+24
| | | | Original patch by Felipe Cruz.
* Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.Antoine Pitrou2012-07-291-3/+17
| | | | Patch by Serhiy Storchaka.
* Backout change e8f44ebacda7052267318cecf5b6f128d35add17. Reverting the testGregory P. Smith2012-06-251-5/+5
| | | | | | | | to using signal.alarm(1) instead of signal.setitimer(signal.ITIMER_REAL, 0.1). This is an attempt to see if this change is what caused the ubuntu arm buildbot to hang in test_io's test_interrupted_write_retry_text. Discussion in Issue #12268.
* Speed up test_io by >2x by reducing the sleep time using setitimer instead ofGregory P. Smith2012-06-241-5/+5
| | | | alarm for the signal tests.
* #4841: Fix FileIO constructor to honor closefd when called repeatedlyHynek Schlawack2012-05-251-0/+13
| | | | Patch by Victor Stinner.
* Issue #13848: open() and the FileIO constructor now check for NUL characters ↵Antoine Pitrou2012-01-291-0/+5
| | | | | | in the file name. Patch by Hynek Schlawack.
* Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError isAntoine Pitrou2011-11-211-4/+74
| | | | | | | raised when the wrapped raw file is non-blocking and the write would block. Previous code assumed that the raw write() would raise BlockingIOError, but RawIOBase.write() is defined to returned None when the call would block. Patch by sbt.
* Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycleCharles-François Natali2011-10-051-0/+15
| | | | | would be finalized after the reference to its underlying BufferedRWPair's writer got cleared by the GC.
* Issue #13087: BufferedReader.seek() now always raises UnsupportedOperationAntoine Pitrou2011-10-041-0/+8
| | | | | if the underlying raw stream is unseekable, even if the seek could be satisfied using the internal buffer. Patch by John O'Connor.
* add a __dict__ descr for IOBase (closes #12878)Benjamin Peterson2011-09-031-0/+11
|
* Issue #12213: Fix a buffering bug with interleaved reads and writes thatAntoine Pitrou2011-08-201-2/+42
| | | | could appear on BufferedRandom streams.
* Fix typo in test namesAntoine Pitrou2011-08-191-4/+4
|
* Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (withoutAntoine Pitrou2011-07-231-0/+21
| | | | | a read1() method), and add an undocumented *write_through* parameter to mandate unbuffered writes.
* Issue #12149: Update the method cache after a type's dictionnary getsAntoine Pitrou2011-07-121-1/+18
| | | | | | | | | cleared by the garbage collector. This fixes a segfault when an instance and its type get caught in a reference cycle, and the instance's deallocator calls one of the methods on the type (e.g. when subclassing IOBase). Diagnosis and patch by Davide Rizzo.
* Issue #12429: Skip interrupted write tests on FreeBSD <= 7Victor Stinner2011-07-041-0/+2
| | | | On FreeBSD, the SIGALRM signal is sometimes received by the reader thread.
* (Merge 3.1) Issue #12175: RawIOBase.readall() now returns None if read()Victor Stinner2011-05-251-2/+5
|\ | | | | | | returns None.
| * Issue #12175: RawIOBase.readall() now returns None if read() returns None.Victor Stinner2011-05-251-2/+5
| |
* | (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.
* | Issue #12062: Fix a flushing bug when doing a certain type of I/O sequenceAntoine Pitrou2011-05-121-0/+26
|\ \ | |/ | | | | | | | | on a file opened in read+write mode (namely: reading, seeking a bit forward, writing, then seeking before the previous write but still within buffered data, and writing again).
| * Issue #12062: Fix a flushing bug when doing a certain type of I/O sequenceAntoine Pitrou2011-05-121-0/+26
| | | | | | | | | | | | on a file opened in read+write mode (namely: reading, seeking a bit forward, writing, then seeking before the previous write but still within buffered data, and writing again).
| * Merged revisions 87427 via svnmerge fromAntoine Pitrou2010-12-211-0/+13
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87427 | antoine.pitrou | 2010-12-21 22:20:59 +0100 (mar., 21 déc. 2010) | 3 lines Issue #10750: The `raw` attribute of buffered IO objects is now read-only. ........
| * Merged revisions 86981,86984 via svnmerge fromAntoine Pitrou2010-12-031-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86981 | antoine.pitrou | 2010-12-03 19:41:39 +0100 (ven., 03 déc. 2010) | 5 lines Issue #10478: Reentrant calls inside buffered IO objects (for example by way of a signal handler) now raise a RuntimeError instead of freezing the current process. ........ r86984 | antoine.pitrou | 2010-12-03 20:14:17 +0100 (ven., 03 déc. 2010) | 3 lines Add an "advanced topics" section to the io doc. ........
| * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-164/+164
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
| * Merged revisions 85482 via svnmerge fromAntoine Pitrou2010-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85482 | antoine.pitrou | 2010-10-14 17:34:31 +0200 (jeu., 14 oct. 2010) | 4 lines Replace the "compiler" resource with the more generic "cpu", so as to mark CPU-heavy tests. ........
| * Merged revisions 84814 via svnmerge fromAntoine Pitrou2010-09-141-10/+34
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84814 | antoine.pitrou | 2010-09-14 20:37:24 +0200 (mar., 14 sept. 2010) | 4 lines Issue #9854: The default read() implementation in io.RawIOBase now handles non-blocking readinto() returning None correctly. ........
| * Merged revisions 84239 via svnmerge fromAntoine Pitrou2010-08-211-1/+74
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84239 | antoine.pitrou | 2010-08-21 21:09:32 +0200 (sam., 21 août 2010) | 4 lines Issue #9617: Signals received during a low-level write operation aren't ignored by the buffered IO layer anymore. ........
| * Merged revisions 83944 via svnmerge fromAntoine Pitrou2010-08-111-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83944 | antoine.pitrou | 2010-08-11 15:31:33 +0200 (mer., 11 août 2010) | 6 lines Issue #9550: a BufferedReader could issue an additional read when the original read request had been satisfied, which can block indefinitely when the underlying raw IO channel is e.g. a socket. Report and original patch by Jason V. Miller. ........
| * Merged revisions 80722 via svnmerge fromAntoine Pitrou2010-05-031-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80722 | antoine.pitrou | 2010-05-03 18:48:20 +0200 (lun., 03 mai 2010) | 11 lines Merged revisions 80720 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80720 | antoine.pitrou | 2010-05-03 18:25:33 +0200 (lun., 03 mai 2010) | 5 lines Issue #7865: The close() method of :mod:`io` objects should not swallow exceptions raised by the implicit flush(). Also ensure that calling close() several times is supported. Patch by Pascal Chambon. ........ ................
| * Merged revisions 77895-77896 via svnmerge fromAntoine Pitrou2010-01-311-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 76806,76808 via svnmerge fromBenjamin Peterson2009-12-131-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 74582 via svnmerge fromAmaury Forgeot d'Arc2009-08-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74582 | amaury.forgeotdarc | 2009-08-30 01:00:38 +0200 (dim., 30 août 2009) | 10 lines Merged revisions 74581 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74581 | amaury.forgeotdarc | 2009-08-29 20:14:40 +0200 (sam., 29 août 2009) | 3 lines #6750: TextIOWrapped could duplicate output when several threads write to it. this affect text files opened with io.open(), and the print() function of py3k ........ ................
| * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-13/+13
| | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
| * Merged revisions 74338 via svnmerge fromAntoine Pitrou2009-08-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74338 | antoine.pitrou | 2009-08-06 22:29:56 +0200 (jeu., 06 août 2009) | 14 lines Merged revisions 74336 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74336 | antoine.pitrou | 2009-08-06 22:18:29 +0200 (jeu., 06 août 2009) | 8 lines Issue #6629: Fix a data corruption issue in the new `io` package, which could occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or "wb+" mode) after having buffered a certain amount of data for reading. This bug was not present in the pure Python implementation. Yes, this is a serious issue. ........ ................
* | Merged revisions 88610 via svnmerge fromAntoine Pitrou2011-02-251-1/+94
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88610 | antoine.pitrou | 2011-02-25 22:24:11 +0100 (ven., 25 févr. 2011) | 4 lines Issue #10956: Buffered I/O classes retry reading or writing after a signal has arrived and the handler returned successfully. ........
* | Issue #10872: The repr() of TextIOWrapper objects now includes the modeAntoine Pitrou2011-01-091-1/+4
| | | | | | | | | | | | if available. (at Georg's request)
* | Issue #10750: The `raw` attribute of buffered IO objects is now read-only.Antoine Pitrou2010-12-211-0/+13
| |
* | Issue #10478: Reentrant calls inside buffered IO objects (for example byAntoine Pitrou2010-12-031-0/+38
| | | | | | | | | | way of a signal handler) now raise a RuntimeError instead of freezing the current process.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-164/+164
| |
* | Issue #10180: Pickling file objects is now explicitly forbidden, sinceAntoine Pitrou2010-11-051-0/+18
| | | | | | | | unpickling them produced nonsensical results.
* | use addCleanupBenjamin Peterson2010-10-311-12/+12
| |
* | patch up leaking fdsBenjamin Peterson2010-10-311-22/+21
| |
* | this test manages the fds itselfBenjamin Peterson2010-10-311-0/+1
| |
* | Silence ResourceWarning when testing that the file destructor closes the file.Brett Cannon2010-10-291-7/+8
| |
* | Issue #10093: ResourceWarnings are now issued when files and sockets areAntoine Pitrou2010-10-291-0/+41
| | | | | | | | | | deallocated without explicit closing. These warnings are silenced by default, except in pydebug mode.