summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (withoutAntoine Pitrou2011-07-231-0/+21
|\ \ | |/ | | | | | | a read1() method), and add a *write_through* parameter to mandate unbuffered writes.
| * 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 #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.
* | Issue #12196: Add PIPE_MAX_SIZE to test.support, constant larger than theCharles-François Natali2011-05-291-1/+1
| | | | | | | | underlying OS pipe buffer size.
* | (Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()Victor Stinner2011-05-251-2/+5
|\ \ | |/ | | | | returns None.
| * (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.2) Issue #12175: FileIO.readall() now raises a ValueError instead ofVictor Stinner2011-05-251-0/+2
|\ \ \ | |/ / | | | | | | an IOError if the file is closed.
| * | (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).
| | * 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 #9971: Write an optimized implementation of BufferedReader.readinto().Antoine Pitrou2011-05-111-0/+6
| | | | | | | | | | | | Patch by John O'Connor.
* | | Issue #8407, issue #11859: Add signal.pthread_sigmask() function to fetchVictor Stinner2011-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | and/or change the signal mask of the calling thread. Fix also tests of test_io using threads and an alarm: use pthread_sigmask() to ensure that the SIGALRM signal is received by the main thread. Original patch written by Jean-Paul Calderone.
* | | Issue #10956: Buffered I/O classes retry reading or writing after a signalAntoine Pitrou2011-02-251-1/+94
| | | | | | | | | | | | has arrived and the handler returned successfully.
* | | Normalize the encoding names for Latin-1 and UTF-8 toMarc-André Lemburg2011-02-251-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
* | | Issue #10990: Prevent tests from clobbering a set trace function.Brett Cannon2011-02-211-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | Many tests simply didn't care if they unset a pre-existing trace function. This made test coverage impossible. This patch fixes various tests to put back any pre-existing trace function. It also introduces test.support.no_tracing as a decorator which will temporarily unset the trace function for tests which simply fail otherwise. Thanks to Kristian Vlaardingerbroek for helping to find the cause of various trace function unsets.
* | 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.
* | Replace the "compiler" resource with the more generic "cpu", soAntoine Pitrou2010-10-141-0/+2
| | | | | | | | as to mark CPU-heavy tests.
* | Issue #9854: The default read() implementation in io.RawIOBase nowAntoine Pitrou2010-09-141-10/+34
| | | | | | | | handles non-blocking readinto() returning None correctly.
* | Issue #9293: I/O streams now raise `io.UnsupportedOperation` when anAntoine Pitrou2010-09-051-7/+47
| | | | | | | | | | unsupported operation is attempted (for example, writing to a file open only for reading).
* | Issue #8990: array.fromstring() and array.tostring() get renamed toAntoine Pitrou2010-09-011-1/+1
| | | | | | | | | | | | frombytes() and tobytes(), respectively, to avoid confusion. Furthermore, array.frombytes(), array.extend() as well as the array.array() constructor now accept bytearray objects. Patch by Thomas Jollans.
* | Issue #9617: Signals received during a low-level write operation aren'tAntoine Pitrou2010-08-211-1/+74
| | | | | | | | ignored by the buffered IO layer anymore.
* | Issue #9550: a BufferedReader could issue an additional read when theAntoine Pitrou2010-08-111-0/+24
| | | | | | | | | | | | 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.