Commit Graph

312 Commits

Author SHA1 Message Date
Serhiy Storchaka 5cfc79deae Issue #20532: Tests which use _testcapi now are marked as CPython only. 2014-02-07 10:06:39 +02:00
Nick Coghlan a9b15241c6 Close #20404: blacklist non-text encodings in io.TextIOWrapper
- io.TextIOWrapper (and hence the open() builtin) now use the
  internal codec marking system added for issue #19619
- also tweaked the C code to only look up the encoding once,
  rather than multiple times
- the existing output type checks remain in place to deal with
  unmarked third party codecs.
2014-02-04 22:11:18 +10:00
Antoine Pitrou 712cb734bd Issue #20037: Avoid crashes when doing text I/O late at interpreter shutdown. 2013-12-21 15:51:54 +01:00
Zachary Ware 101d9e7250 Issue 19572: More silently skipped tests explicitly skipped. 2013-12-08 00:44:27 -06:00
Zachary Ware 9fe6d86709 Issue 19572: More silently skipped tests explicitly skipped. 2013-12-08 00:20:35 -06:00
Serhiy Storchaka 2480c2ed59 Issue #15204: Silence and check the 'U' mode deprecation warnings in tests.
Changed deprecation message in the fileinput module.
2013-11-24 23:13:26 +02:00
Antoine Pitrou 796564c27b Issue #18112: PEP 442 implementation (safe object finalization). 2013-07-30 19:59:21 +02:00
Victor Stinner 775b2dd778 test_io: check_interrupted_write() now cancels the alarm if ZeroDivisionError
exception was not raised.

Before the process was killed by SIGALRM in another random test (1 second later)
2013-07-15 19:53:13 +02:00
Serhiy Storchaka 37a79a12d1 Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
stream's read() returns more bytes than requested.
2013-05-28 16:24:45 +03:00
Serhiy Storchaka 281945f427 Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
stream's read() returns more bytes than requested.
2013-05-28 16:27:08 +03:00
Antoine Pitrou 34373b2252 Issue #17835: Fix test_io when the default OS pipe buffer size is larger than one million bytes. 2013-04-24 23:33:20 +02:00
Antoine Pitrou e1a1674e1e Issue #17835: Fix test_io when the default OS pipe buffer size is larger than one million bytes. 2013-04-24 23:31:38 +02:00
Ezio Melotti e94cbd188b #17479: merge with 3.3. 2013-03-23 16:36:58 +02:00
Ezio Melotti daa42c778e #17479: test_io now works with unittest test discovery. Patch by Zachary Ware. 2013-03-23 16:30:16 +02:00
R David Murray d7c59e101f Merge #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 22:21:48 -05:00
R David Murray 9f10f56d13 Merge #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 22:07:55 -05:00
R David Murray 67bfe80758 #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 21:51:05 -05:00
Serhiy Storchaka cce1b8eda8 Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
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).
2013-02-03 17:09:17 +02:00
Serhiy Storchaka d03ce4ae3d Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
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).
2013-02-03 17:07:32 +02:00
Serhiy Storchaka 94dc6736bd Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
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).
2013-02-03 17:03:31 +02:00
Serhiy Storchaka 441d30fac7 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:26:26 +02:00
Serhiy Storchaka 9101e23ff6 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:41:45 +02:00
Serhiy Storchaka 7898043868 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.
2013-01-15 01:12:17 +02:00
Andrew Svetlov f7a17b48d7 Replace IOError with OSError (#16715) 2012-12-25 16:47:37 +02:00
Benjamin Peterson 4c05969fc4 merge 3.3 (#16597) 2012-12-20 11:55:16 -06:00
Benjamin Peterson 68623614f0 call close on the underlying stream even if flush raises (closes #16597)
Patch by Serhiy Storchaka.
2012-12-20 11:53:11 -06:00
Andrew Svetlov 3438fa496d Get rig of EnvironmentError (#16705) 2012-12-17 23:35:18 +02:00
Antoine Pitrou 8261f838ff Merge for issue #15744: add tests for the writelines() method of file objects. 2012-10-16 23:06:17 +02:00
Antoine Pitrou 0c7081aff4 Merge for issue #15744: add tests for the writelines() method of file objects. 2012-10-16 23:05:01 +02:00
Antoine Pitrou 3ed2cb5520 Also add tests for TextIOWrapper.writelines() (issue #15744). 2012-10-16 23:02:27 +02:00
Antoine Pitrou 131a489903 Add tests for the writelines() method of file objects.
Original patch by Felipe Cruz.
2012-10-16 22:57:11 +02:00
Jesus Cea dc469454ec Closes #15488: Closed files keep their buffer alive 2012-10-04 12:37:56 +02:00
Christian Heimes 7b648753ab Added test for 85cb90f79cbf and see how the code handles all flags at once 2012-09-10 14:48:43 +02:00
Antoine Pitrou a264384fe6 Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
Patch by Serhiy Storchaka.
2012-07-29 19:04:57 +02:00
Antoine Pitrou 10f0c50a0b Issue #15487: Add a __sizeof__ implementation for buffered I/O objects.
Patch by Serhiy Storchaka.
2012-07-29 19:02:46 +02:00
Florent Xicluna 109d57358e Issue #13248: io: Remove obsolete argument "max_buffer_size" of BufferedWriter and BufferedRWPair. 2012-07-07 17:03:22 +02:00
Gregory P. Smith 875c1bc522 Backout change e8f44ebacda7052267318cecf5b6f128d35add17. Reverting the test
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.
2012-06-25 01:15:14 -07:00
Gregory P. Smith b5ba203709 Backout change e8f44ebacda7052267318cecf5b6f128d35add17. Reverting the test
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.
2012-06-25 01:13:32 -07:00
Gregory P. Smith 990a5feba7 Fixes issue #12268: File readline, readlines and read() or readall() methods
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.
2012-06-24 00:23:47 -07:00
Gregory P. Smith 8150492f11 Speed up test_io by >2x by reducing the sleep time using setitimer instead of
alarm for the signal tests.
2012-06-23 23:46:37 -07:00
Jesus Cea 9436361e4c Closes #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-22 18:32:07 +02:00
Victor Stinner f86a5e8a93 Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
open() and io.TextIOWrapper are now calling locale.getpreferredencoding(False)
instead of locale.getpreferredencoding() in text mode if the encoding is not
specified. Don't change temporary the locale encoding using locale.setlocale(),
use the current locale encoding instead of the user preferred encoding.

Explain also in open() documentation that locale.getpreferredencoding(False) is
called if the encoding is not specified.
2012-06-05 13:43:22 +02:00
Hynek Schlawack 9866d96e48 #4841: Fix FileIO constructor to honor closefd when called repeatedly
Patch by Victor Stinner.
2012-05-25 10:27:43 +02:00
Hynek Schlawack 2cc7156515 #4841: Fix FileIO constructor to honor closefd when called repeatedly
Patch by Victor Stinner.
2012-05-25 10:05:53 +02:00
Antoine Pitrou 7ab4af0427 Issue #13848: open() and the FileIO constructor now check for NUL characters in the file name.
Patch by Hynek Schlawack.
2012-01-29 18:43:36 +01:00
Antoine Pitrou 1334884ff2 Issue #13848: open() and the FileIO constructor now check for NUL characters in the file name.
Patch by Hynek Schlawack.
2012-01-29 18:36:34 +01:00
Charles-François Natali dc3044c704 Issue #12760: Add a create mode to open(). Patch by David Townshend. 2012-01-09 22:40:02 +01:00
Antoine Pitrou 7fe601c5bf Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError is
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.
2011-11-21 20:22:01 +01:00
Antoine Pitrou 58fcf9f801 Issue #13322: Fix BufferedWriter.write() to ensure that BlockingIOError is
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.
2011-11-21 20:16:44 +01:00
Ross Lagerwall 59142db6d3 Issue #12797: Added custom opener parameter to builtin open() and FileIO.open(). 2011-10-31 20:34:46 +02:00
Antoine Pitrou 6b4883dec0 PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy. 2011-10-12 02:54:14 +02:00
Charles-François Natali 42c28cdd1d Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
2011-10-05 19:53:43 +02:00
Antoine Pitrou 1e44fecc52 Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer.  Patch by John O'Connor.
2011-10-04 12:26:20 +02:00
Charles-François Natali b619bb27ed Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
2011-10-05 19:55:56 +02:00
Antoine Pitrou bf009f0bce Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer.  Patch by John OConnor.
2011-10-04 12:28:52 +02:00
Ezio Melotti d8b509b192 #13012: use splitlines(keepends=True/False) instead of splitlines(0/1). 2011-09-28 17:37:55 +03:00
Benjamin Peterson 9fd5374d4e merge 3.2 (#12878) 2011-09-03 09:32:24 -04:00
Benjamin Peterson f6f3a35447 add a __dict__ descr for IOBase (closes #12878) 2011-09-03 09:26:20 -04:00
Antoine Pitrou e8bb1a0229 Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
2011-08-20 14:52:04 +02:00
Antoine Pitrou e05565ec5a Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
2011-08-20 14:39:23 +02:00
Antoine Pitrou 107d65d144 Fix typo in test names 2011-08-19 20:33:11 +02:00
Antoine Pitrou 20db51108c Fix typo in test names 2011-08-19 20:32:34 +02:00
Antoine Pitrou d42c1d09e9 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add a *write_through* parameter to
mandate unbuffered writes.
2011-07-23 21:50:21 +02:00
Antoine Pitrou e96ec68101 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add an undocumented *write_through* parameter to
mandate unbuffered writes.
2011-07-23 21:46:35 +02:00
Antoine Pitrou 093c8e4bf0 Issue #12149: Update the method cache after a type's dictionnary gets
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.
2011-07-12 21:58:39 +02:00
Antoine Pitrou 84f1b1718d Issue #12149: Update the method cache after a type's dictionnary gets
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.
2011-07-12 21:57:15 +02:00
Victor Stinner cd1aa0d5ea Issue #12429: Skip interrupted write tests on FreeBSD <= 7
On FreeBSD, the SIGALRM signal is sometimes received by the reader thread.
2011-07-04 11:48:17 +02:00
Charles-François Natali 2d51721832 Issue #12196: Add PIPE_MAX_SIZE to test.support, constant larger than the
underlying OS pipe buffer size.
2011-05-29 16:36:44 +02:00
Victor Stinner d2780aedce (Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
2011-05-25 22:51:16 +02:00
Victor Stinner 988512cfd7 (Merge 3.1) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
2011-05-25 22:49:15 +02:00
Victor Stinner a80987f20d Issue #12175: RawIOBase.readall() now returns None if read() returns None. 2011-05-25 22:47:16 +02:00
Victor Stinner af62c7d3de (Merge 3.2) Issue #12175: FileIO.readall() now raises a ValueError instead of
an IOError if the file is closed.
2011-05-25 22:13:47 +02:00
Victor Stinner 4767114e77 (Merge 3.1) Issue #12175: FileIO.readall() now raises a ValueError instead of
an IOError if the file is closed.
2011-05-25 22:11:55 +02:00
Victor Stinner b79f28ccbd Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError if
the file is closed.
2011-05-25 22:09:03 +02:00
Antoine Pitrou b89b31a158 Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
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).
2011-05-13 00:25:53 +02:00
Antoine Pitrou 00dd182b8e Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
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).
2011-05-13 00:16:28 +02:00
Antoine Pitrou 7c40489180 Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
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).
2011-05-13 00:13:33 +02:00
Antoine Pitrou 3486a98dcd Issue #9971: Write an optimized implementation of BufferedReader.readinto().
Patch by John O'Connor.
2011-05-12 01:57:53 +02:00
Victor Stinner a929335961 Issue #8407, issue #11859: Add signal.pthread_sigmask() function to fetch
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.
2011-04-30 15:21:58 +02:00
Antoine Pitrou d843c2d86f Merged revisions 88610 via svnmerge from
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.
........
2011-02-25 21:34:39 +00:00
Antoine Pitrou 707ce82cab Issue #10956: Buffered I/O classes retry reading or writing after a signal
has arrived and the handler returned successfully.
2011-02-25 21:24:11 +00:00
Marc-André Lemburg 8f36af7a4c Normalize the encoding names for Latin-1 and UTF-8 to
'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.
2011-02-25 15:42:01 +00:00
Brett Cannon 31f5929c1e Issue #10990: Prevent tests from clobbering a set trace function.
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.
2011-02-21 19:29:56 +00:00
Antoine Pitrou a4815caa7c Issue #10872: The repr() of TextIOWrapper objects now includes the mode
if available.

(at Georg's request)
2011-01-09 20:38:15 +00:00
Antoine Pitrou 6cfc5124f2 Merged revisions 87427 via svnmerge from
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.
........
2010-12-21 21:26:09 +00:00
Antoine Pitrou 7f8f41808b Issue #10750: The `raw` attribute of buffered IO objects is now read-only. 2010-12-21 21:20:59 +00:00
Antoine Pitrou 976157f9f3 Merged revisions 86981,86984 via svnmerge from
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.
........
2010-12-03 19:21:49 +00:00
Antoine Pitrou f3b68b3f98 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.
2010-12-03 18:41:39 +00:00
Ezio Melotti 19f2aeba67 Merged revisions 86596 via svnmerge from
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.
........
2010-11-21 01:30:29 +00:00
Ezio Melotti b3aedd4862 #9424: Replace deprecated assert* methods in the Python test suite. 2010-11-20 19:04:17 +00:00
Antoine Pitrou 243757eb79 Issue #10180: Pickling file objects is now explicitly forbidden, since
unpickling them produced nonsensical results.
2010-11-05 21:15:39 +00:00
Benjamin Peterson 556c7355dd use addCleanup 2010-10-31 01:35:43 +00:00
Benjamin Peterson ebe5d8ae3b patch up leaking fds 2010-10-31 01:30:11 +00:00
Benjamin Peterson d8fc2e1aeb this test manages the fds itself 2010-10-31 01:19:53 +00:00
Brett Cannon 5a9e91b050 Silence ResourceWarning when testing that the file destructor closes the file. 2010-10-29 23:53:03 +00:00
Antoine Pitrou e033e06db0 Issue #10093: ResourceWarnings are now issued when files and sockets are
deallocated without explicit closing.  These warnings are silenced by
default, except in pydebug mode.
2010-10-29 10:38:18 +00:00
Antoine Pitrou 2731494720 Merged revisions 85482 via svnmerge from
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.
........
2010-10-14 15:41:23 +00:00
Antoine Pitrou 5bc4fa7a49 Replace the "compiler" resource with the more generic "cpu", so
as to mark CPU-heavy tests.
2010-10-14 15:34:31 +00:00
Antoine Pitrou e5e75c64f2 Merged revisions 84814 via svnmerge from
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.
........
2010-09-14 18:53:07 +00:00
Antoine Pitrou 328ec7455f Issue #9854: The default read() implementation in io.RawIOBase now
handles non-blocking readinto() returning None correctly.
2010-09-14 18:37:24 +00:00
Antoine Pitrou 0d739d7047 Issue #9293: I/O streams now raise `io.UnsupportedOperation` when an
unsupported operation is attempted (for example, writing to a file open
only for reading).
2010-09-05 23:01:12 +00:00
Antoine Pitrou 1ce3eb5c5b Issue #8990: array.fromstring() and array.tostring() get renamed to
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.
2010-09-01 20:29:34 +00:00
Antoine Pitrou 16b11de04e Merged revisions 84239 via svnmerge from
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.
........
2010-08-21 19:17:57 +00:00
Antoine Pitrou b46b9d59ef Issue #9617: Signals received during a low-level write operation aren't
ignored by the buffered IO layer anymore.
2010-08-21 19:09:32 +00:00
Antoine Pitrou 00091cada6 Merged revisions 83944 via svnmerge from
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.
........
2010-08-11 13:38:10 +00:00
Antoine Pitrou 32cfedeb1c 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.
2010-08-11 13:31:33 +00:00
Antoine Pitrou faf9007d86 Merged revisions 80722 via svnmerge from
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.
  ........
................
2010-05-03 16:58:19 +00:00
Antoine Pitrou 6be8876623 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.
........
2010-05-03 16:48:20 +00:00
Victor Stinner 45df820591 Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines

  Issue #7449, part 1: fix test_support.py for Python compiled without thread
........
  r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line

  Issue #7449, part 2: regrtest.py -j option requires thread support
........
  r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines

  Issue #7449 part 3, test_doctest: import trace module in test_coverage()

  Import trace module fail if the threading module is missing. test_coverage() is
  only used if test_doctest.py is used with the -c option. This commit allows to
  execute the test suite without thread support.

  Move "import trace" in test_coverage() and use
  test_support.import_module('trace').
........
  r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines

  Issue #7449, part 4: skip test_multiprocessing if thread support is disabled

  import threading after _multiprocessing to raise a more revelant error message:
  "No module named _multiprocessing". _multiprocessing is not compiled without
  thread support.
........
  r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines

  Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py

   * Split Test.test_open() in 2 functions: test_open() and test_thread_open()
   * Skip test_open() and test_thread_open() if we are unable to find the C
     library
   * Skip test_thread_open() if thread support is disabled
   * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError()
........
  r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines

  Issue #7449, part 6: fix test_hashlib for missing threading module

  Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing().
........
  r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, part 7: simplify threading detection in test_capi

   * Skip TestPendingCalls if threading module is missing
   * Test if threading module is present or not, instead of test the presence of
     _testcapi._test_thread_state
........
  r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines

  Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing

  TestFifo can be executed without the threading module
........
  r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, part 9: fix test_xmlrpclib for missing threading module

   * Skip testcases using threads if threading module is missing
   * Use "http://" instead of URL in ServerProxyTestCase if threading is missing
     because URL is not set in this case
........
  r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines

  Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)

  Rewrite r80556: the thread test have to be executed just after the test on
  libc_open() and so the test cannot be splitted in two functions (without
  duplicating code, and I don't want to duplicate code).
........
  r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines

  Issue #7449, part 10: test_cmd imports trace module using test_support.import_module()

  Use test_support.import_module() instead of import to raise a SkipTest
  exception if the import fail. Import trace fails if the threading module is
  missing.

  See also part 3: test_doctest: import trace module in test_coverage().
........
  r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines

  Issue #7449, last part (11): fix many tests if thread support is disabled

   * Use try/except ImportError or test_support.import_module() to import thread
     and threading modules
   * Add @unittest.skipUnless(threading, ...) to testcases using threads
........
2010-04-28 22:31:17 +00:00
Florent Xicluna 41fe615539 (partially)
Merged revisions 79534,79537,79539,79558,79606 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79534 | florent.xicluna | 2010-03-31 23:21:54 +0200 (mer, 31 mar 2010) | 2 lines

  Fix test for xml.etree when using a non-ascii path.  And use check_warnings instead of catch_warnings.
........
  r79537 | florent.xicluna | 2010-03-31 23:40:32 +0200 (mer, 31 mar 2010) | 2 lines

  Fix typo
........
  r79539 | florent.xicluna | 2010-04-01 00:01:03 +0200 (jeu, 01 avr 2010) | 2 lines

  Replace catch_warnings with check_warnings when it makes sense.  Use assertRaises context manager to simplify some tests.
........
  r79558 | florent.xicluna | 2010-04-01 20:17:09 +0200 (jeu, 01 avr 2010) | 2 lines

  #7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote.
........
  r79606 | florent.xicluna | 2010-04-02 19:26:42 +0200 (ven, 02 avr 2010) | 2 lines

  Backport some robotparser test and skip the test if the external resource is not available.
........
2010-04-02 18:52:12 +00:00
Florent Xicluna 8fbddf15ea Merged revisions 79030-79032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79030 | florent.xicluna | 2010-03-17 20:05:04 +0100 (mer, 17 mar 2010) | 2 lines

  Cleanup in test_import and test_coding.
........
  r79031 | florent.xicluna | 2010-03-17 20:15:56 +0100 (mer, 17 mar 2010) | 2 lines

  Cleanup some test cases using check_warnings and check_py3k_warnings.
........
  r79032 | florent.xicluna | 2010-03-17 21:05:11 +0100 (mer, 17 mar 2010) | 2 lines

  Fix and check cgi module deprecation warnings.  Revert an unwanted rename in test_import.
........
2010-03-17 20:29:51 +00:00
Georg Brandl 1b37e8728c Merged revisions 78093 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line

  Remove unused imports in test modules.
........
2010-03-14 10:45:50 +00:00
Antoine Pitrou 66f9fea782 Merged revisions 77895-77896 via svnmerge from
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.
................
2010-01-31 23:20:26 +00:00
Antoine Pitrou 905a2ffe3e 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.
........
2010-01-31 22:47:27 +00:00
Ezio Melotti e96159335f Merged revisions 77727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line

  use assert[Not]IsInstance where appropriate
........
2010-01-24 19:26:24 +00:00
Benjamin Peterson 6b59f77c43 Merged revisions 76806,76808 via svnmerge from
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
  ........
................
2009-12-13 19:30:15 +00:00
Benjamin Peterson bf5ff76597 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.
........
2009-12-13 19:25:34 +00:00
Amaury Forgeot d'Arc af0312af7a Merged revisions 74582 via svnmerge from
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
  ........
................
2009-08-29 23:19:16 +00:00
Amaury Forgeot d'Arc ccd686a473 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
........
2009-08-29 23:00:38 +00:00
Georg Brandl ab91fdef1f Merged revisions 73715 via svnmerge from
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*
........
2009-08-13 08:51:18 +00:00
Antoine Pitrou 0473e56964 Merged revisions 74338 via svnmerge from
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.
  ........
................
2009-08-06 20:52:43 +00:00
Antoine Pitrou a0ceb731fb 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.
........
2009-08-06 20:29:56 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00
Hirokazu Yamamoto c7d6aa43b7 Merged revisions 73461 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73461 | hirokazu.yamamoto | 2009-06-17 16:05:33 +0900 | 1 line

  Issue #6215: Fixed to use self.open() instead of open() or io.open().
........
2009-06-18 00:07:14 +00:00
Benjamin Peterson 0926ad1f05 give the C implementation of TextIOWrapper the errors property #6217 2009-06-06 18:02:12 +00:00
Antoine Pitrou 716c444edc Issue #5761: Add the name of the underlying file to the repr() of various IO objects. 2009-05-23 19:04:03 +00:00
Benjamin Peterson 81971eafbe correctly handle invalid operations on streams (like writing on a non-writable one) 2009-05-14 22:01:31 +00:00
Antoine Pitrou e450185b4a Issue #5006: Better handling of unicode byte-order marks (BOM) in the io library.
This means, for example, that opening an UTF-16 text file in
append mode doesn't add a BOM at the end of the file if the file isn't
empty.
2009-05-14 18:55:55 +00:00
Benjamin Peterson d2e0c7955f implement a detach() method for BufferedIOBase and TextIOBase #5883 2009-05-01 20:40:59 +00:00
Benjamin Peterson 6a52a9cfcb fix test__all__ 2009-04-29 22:00:44 +00:00
Benjamin Peterson 24fb1d0a7b these tests must call gc_collect() for non-refcounting gcs 2009-04-24 23:26:21 +00:00
Benjamin Peterson 45cec32f7d make sure to close files 2009-04-24 23:14:50 +00:00
Benjamin Peterson b01138a66e readline() args must be an int #3521 2009-04-24 22:59:52 +00:00
Antoine Pitrou c50cb8e9c1 Fix use of test skipping API. 2009-04-19 00:10:36 +00:00
Antoine Pitrou cf4c749680 Issue #5734: BufferedRWPair was poorly tested and had several glaring bugs.
Patch by Brian Quinlan.
2009-04-19 00:09:36 +00:00
Benjamin Peterson 20c3b55622 use the more offical skipping api 2009-04-18 14:49:19 +00:00
Benjamin Peterson bfb959404f Merged revisions 71014 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71014 | benjamin.peterson | 2009-04-01 20:03:17 -0500 (Wed, 01 Apr 2009) | 1 line

  handle SEEK_ constants in test_io
........
2009-04-02 01:13:40 +00:00
Benjamin Peterson a1b49013f4 fix TextIOWrapper.read() when the buffer is not readable #5628 2009-03-31 23:11:32 +00:00
Antoine Pitrou 7d037a7b52 Plug another leak, and finally add a test for #1174606 (read() from /dev/zero).
The leak was the reason my previous attempts at testing failed...
2009-03-29 18:55:12 +00:00
Benjamin Peterson 59406a9d85 officially deprecated max_buffer_size 2009-03-26 17:10:29 +00:00
Benjamin Peterson c4c0eaebbf give TextIOWrapper a repr that tells you the encoding 2009-03-09 00:07:03 +00:00
Antoine Pitrou 66913e2213 Issue #5433: Excessive newline detection optimization in IncrementalNewlineDecoder 2009-03-06 23:40:56 +00:00
Benjamin Peterson 5fd871d724 rename 2009-03-05 00:49:53 +00:00
Benjamin Peterson 9363a65b2c fix #4862 in _pyio: reset the decoder on seek(0) 2009-03-05 00:42:09 +00:00
Benjamin Peterson 4fa88fa0ba merge the io-c branch: C implementation of the io module
The main io module now uses the C implementation.  The Python one still exists
in Lib/_pyio.py for ease of testing new features and usefulness to other
implementers.

The rewrite was done by Antoine Pitrou and Amaury Forgeot d'Arc.  I was slightly
helpful at the end. :)


Following are the log messages from the io-c branch:

Merged revisions 68683-68685,68687-68689,68693,68704,68741-68743,68745,68747,68752-68754,68756,68758,68812,68816-68817,68820-68822,68824-68825,68828,68876-68877,69037,69044,69104,69115,69194,69626-69629,69636,69638,69641-69642,69644-69654,69656-69661,69671,69677,69812-69815,69817,69827-69830,69839,69841-69845,69848,69850,69852,69854,69860,69865-69866,69868,69872-69873,69885,69888,69891-69893,69911,69913-69916,69963,70033,70035,70038,70041-70048,70067-70070,70075,70112,70133,70135,70140 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/io-c

........
  r68683 | antoine.pitrou | 2009-01-17 17:13:48 -0600 (Sat, 17 Jan 2009) | 3 lines

  Merge in changes from the io-c sandbox. Tests will follow in separate commits.
........
  r68684 | antoine.pitrou | 2009-01-17 17:17:26 -0600 (Sat, 17 Jan 2009) | 3 lines

  Fixes and additions to test_io.py
........
  r68685 | antoine.pitrou | 2009-01-17 17:22:04 -0600 (Sat, 17 Jan 2009) | 1 line

  Fix test_fileio
........
  r68687 | antoine.pitrou | 2009-01-17 17:35:11 -0600 (Sat, 17 Jan 2009) | 3 lines

  Add dependency to _iomodule.h for the various C sources
........
  r68688 | antoine.pitrou | 2009-01-17 17:38:18 -0600 (Sat, 17 Jan 2009) | 3 lines

  These precautions are not needed anymore!
........
  r68689 | antoine.pitrou | 2009-01-17 17:41:48 -0600 (Sat, 17 Jan 2009) | 3 lines

  Fix another test
........
  r68693 | antoine.pitrou | 2009-01-17 17:49:58 -0600 (Sat, 17 Jan 2009) | 3 lines

  Fix test_uu (which was using private attributes of TextIOWrapper)
........
  r68704 | antoine.pitrou | 2009-01-17 18:45:29 -0600 (Sat, 17 Jan 2009) | 3 lines

  Most io sources are Py_ssize_t-clean (I don't know about bytesio and stringio)
........
  r68741 | antoine.pitrou | 2009-01-18 15:20:30 -0600 (Sun, 18 Jan 2009) | 3 lines

  Check return type in TextIOWrapper.__next__
........
  r68742 | antoine.pitrou | 2009-01-18 15:28:48 -0600 (Sun, 18 Jan 2009) | 4 lines

  Make binary buffered readline and iteration much faster
  (8x as fast as the IOBase generic implementation)
........
  r68743 | antoine.pitrou | 2009-01-18 15:47:47 -0600 (Sun, 18 Jan 2009) | 3 lines

  Reinsert test_io_after_close (was removed by mistake)
........
  r68745 | antoine.pitrou | 2009-01-18 16:16:06 -0600 (Sun, 18 Jan 2009) | 3 lines

  Add read, read1 and write methods to BufferedIOBase
........
  r68747 | antoine.pitrou | 2009-01-18 16:35:58 -0600 (Sun, 18 Jan 2009) | 3 lines

  Kill test failure
........
  r68752 | amaury.forgeotdarc | 2009-01-18 17:05:43 -0600 (Sun, 18 Jan 2009) | 3 lines

  Fix a segfault when e.g a BufferedReader is created with a FileIO in
  read mode.
........
  r68753 | antoine.pitrou | 2009-01-18 17:13:09 -0600 (Sun, 18 Jan 2009) | 3 lines

  Add truncate() to text IO objects
........
  r68754 | antoine.pitrou | 2009-01-18 17:51:08 -0600 (Sun, 18 Jan 2009) | 3 lines

  Remove IOBase.__del__ and replace it with custom code with tp_dealloc
........
  r68756 | antoine.pitrou | 2009-01-18 18:10:16 -0600 (Sun, 18 Jan 2009) | 3 lines

  Remove irrelevant comment.
........
  r68758 | antoine.pitrou | 2009-01-18 18:36:16 -0600 (Sun, 18 Jan 2009) | 3 lines

  in importlib:_fileio._FileIO -> _io.FileIO
........
  r68812 | antoine.pitrou | 2009-01-20 14:15:51 -0600 (Tue, 20 Jan 2009) | 3 lines

  Add garbage collection support to FileIO objects
........
  r68816 | antoine.pitrou | 2009-01-20 14:56:28 -0600 (Tue, 20 Jan 2009) | 3 lines

  Add GC support to Buffered and Text IO objects
........
  r68817 | antoine.pitrou | 2009-01-20 15:19:45 -0600 (Tue, 20 Jan 2009) | 3 lines

  Add some file headers
........
  r68820 | antoine.pitrou | 2009-01-20 15:29:59 -0600 (Tue, 20 Jan 2009) | 3 lines

  Add class TextIOBase
........
  r68821 | antoine.pitrou | 2009-01-20 15:36:16 -0600 (Tue, 20 Jan 2009) | 3 lines

  Add properties to TextIOBase
........
  r68822 | antoine.pitrou | 2009-01-20 15:41:19 -0600 (Tue, 20 Jan 2009) | 3 lines

  Disable the pure Python TextIOBase class, and inject C the implementation instead
........
  r68824 | antoine.pitrou | 2009-01-20 16:36:28 -0600 (Tue, 20 Jan 2009) | 3 lines

  Fix two leaks
........
  r68825 | antoine.pitrou | 2009-01-20 16:38:29 -0600 (Tue, 20 Jan 2009) | 3 lines

  FileIO.name is just a plain attribute, we can set it directly
........
  r68828 | antoine.pitrou | 2009-01-20 17:06:33 -0600 (Tue, 20 Jan 2009) | 3 lines

  Speed up closed checks on text IO objects. Good for a 25% speedup on small ops.
........
  r68876 | antoine.pitrou | 2009-01-23 17:01:25 -0600 (Fri, 23 Jan 2009) | 3 lines

  Two typos
........
  r68877 | antoine.pitrou | 2009-01-23 18:13:20 -0600 (Fri, 23 Jan 2009) | 3 lines

  Remove two unused functions
........
  r69037 | amaury.forgeotdarc | 2009-01-27 17:10:25 -0600 (Tue, 27 Jan 2009) | 2 lines

  Update the win32 project files
........
  r69044 | antoine.pitrou | 2009-01-27 18:51:07 -0600 (Tue, 27 Jan 2009) | 3 lines

  Improve heuristic in IncrementalNewlineDecoder + some micro-optimizations
........
  r69104 | antoine.pitrou | 2009-01-29 15:23:42 -0600 (Thu, 29 Jan 2009) | 3 lines

  Fix some crashers found by Victor
........
  r69115 | hirokazu.yamamoto | 2009-01-29 20:36:28 -0600 (Thu, 29 Jan 2009) | 1 line

  Updated VC6 project file.
........
  r69194 | antoine.pitrou | 2009-02-01 16:57:18 -0600 (Sun, 01 Feb 2009) | 3 lines

  Fix downcasting warnings in 32-bit mode with 64-bit offsets (Windows)
........
  r69626 | benjamin.peterson | 2009-02-14 17:33:34 -0600 (Sat, 14 Feb 2009) | 1 line

  only catch AttributeError and UnsupportedOperation
........
  r69627 | benjamin.peterson | 2009-02-14 21:35:28 -0600 (Sat, 14 Feb 2009) | 1 line

  give the IO module its own state and store the os and locale modules in it
........
  r69628 | benjamin.peterson | 2009-02-14 22:08:32 -0600 (Sat, 14 Feb 2009) | 1 line

  put interned strings in the module state structure
........
  r69629 | benjamin.peterson | 2009-02-14 22:15:29 -0600 (Sat, 14 Feb 2009) | 1 line

  put UnsupportedOperation in the module state
........
  r69636 | benjamin.peterson | 2009-02-15 08:31:42 -0600 (Sun, 15 Feb 2009) | 1 line

  dealloc unsupported_operation
........
  r69638 | benjamin.peterson | 2009-02-15 09:24:45 -0600 (Sun, 15 Feb 2009) | 1 line

  actually test the C implementation
........
  r69641 | benjamin.peterson | 2009-02-15 10:12:37 -0600 (Sun, 15 Feb 2009) | 5 lines

  make interned strings globals again ;(

  putting them in the module state was asking for trouble when the module
  was dealloced before the classes in it were
........
  r69642 | benjamin.peterson | 2009-02-15 10:19:45 -0600 (Sun, 15 Feb 2009) | 1 line

  actually test the python implementations
........
  r69644 | antoine.pitrou | 2009-02-15 11:59:30 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix memory leak in destructor when a Python class inherits from IOBase (or an IOBase-derived type)
........
  r69645 | antoine.pitrou | 2009-02-15 12:23:26 -0600 (Sun, 15 Feb 2009) | 3 lines

  Add a warning about the embarassing state of IOBase finalization
........
  r69646 | antoine.pitrou | 2009-02-15 13:14:42 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix opening of 8-bit filenames with FileIO
........
  r69647 | antoine.pitrou | 2009-02-15 13:20:22 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix leak in FileIO constructor
........
  r69648 | antoine.pitrou | 2009-02-15 13:58:16 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix some refleaks
........
  r69649 | antoine.pitrou | 2009-02-15 14:05:13 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix a leak in IOBase.writelines
........
  r69650 | antoine.pitrou | 2009-02-15 14:11:56 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix memory leak in BufferedWriter.truncate
........
  r69651 | antoine.pitrou | 2009-02-15 14:25:34 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix a leak in TextIOWrapper.seek
........
  r69652 | antoine.pitrou | 2009-02-15 14:26:28 -0600 (Sun, 15 Feb 2009) | 3 lines

  Unify implementations of truncate for buffered objects
........
  r69653 | antoine.pitrou | 2009-02-15 15:15:15 -0600 (Sun, 15 Feb 2009) | 3 lines

  Fix more leaks in TextIOWrapper
........
  r69654 | antoine.pitrou | 2009-02-15 15:21:57 -0600 (Sun, 15 Feb 2009) | 3 lines

  Smaller chunk size for a faster test
........
  r69656 | benjamin.peterson | 2009-02-15 17:29:48 -0600 (Sun, 15 Feb 2009) | 1 line

  braces make this much clearer
........
  r69657 | benjamin.peterson | 2009-02-15 17:46:07 -0600 (Sun, 15 Feb 2009) | 1 line

  use the correct macro
........
  r69658 | antoine.pitrou | 2009-02-15 19:38:59 -0600 (Sun, 15 Feb 2009) | 5 lines

  Fix crash in test_urllib2_localnet in debug mode. It was due to an HTTPResponse
  object being revived when calling its close() method in IOBase's tp_dealloc.
  _PyIOBase_finalize() starts looking scary...
........
  r69659 | benjamin.peterson | 2009-02-15 20:55:48 -0600 (Sun, 15 Feb 2009) | 1 line

  fix segfault on initialization failing
........
  r69660 | benjamin.peterson | 2009-02-15 21:09:31 -0600 (Sun, 15 Feb 2009) | 1 line

  apparently locale.getprefferedencoding() can raise a ImportError, too
........
  r69661 | benjamin.peterson | 2009-02-15 21:54:15 -0600 (Sun, 15 Feb 2009) | 1 line

  it's amazing this worked at all; I was using the wrong structs!
........
  r69671 | benjamin.peterson | 2009-02-16 08:38:27 -0600 (Mon, 16 Feb 2009) | 1 line

  add garbage collection support to bytesio
........
  r69677 | benjamin.peterson | 2009-02-16 10:31:03 -0600 (Mon, 16 Feb 2009) | 5 lines

  reduce ImportError catching code duplication

  I'm not sure this makes the code clearer with its new gotos, but
  at least I added a big fat comment
........
  r69812 | antoine.pitrou | 2009-02-20 13:50:16 -0600 (Fri, 20 Feb 2009) | 3 lines

  _StringIO now belongs to the _io modules, rather to its own _stringio module
........
  r69813 | antoine.pitrou | 2009-02-20 13:58:22 -0600 (Fri, 20 Feb 2009) | 3 lines

  Add a test for StringIO properties
........
  r69814 | antoine.pitrou | 2009-02-20 14:06:03 -0600 (Fri, 20 Feb 2009) | 3 lines

  Reimplement a few trivial StringIO functions and properties in C
........
  r69815 | antoine.pitrou | 2009-02-20 14:13:11 -0600 (Fri, 20 Feb 2009) | 3 lines

  Add the line_buffering property to TextIOWrapper, and test for it
........
  r69817 | antoine.pitrou | 2009-02-20 14:45:50 -0600 (Fri, 20 Feb 2009) | 4 lines

  Allow IncrementalNewlineDecoder to take unicode objects as decoding input if the decoder parameter is None
  This will help rewriting StringIO to C
........
  r69827 | antoine.pitrou | 2009-02-20 19:00:30 -0600 (Fri, 20 Feb 2009) | 3 lines

  Rewrite most of StringIO in C. Some almost empty stubs remain to be converted.
........
  r69828 | antoine.pitrou | 2009-02-20 19:09:25 -0600 (Fri, 20 Feb 2009) | 3 lines

  Plug a leak, and remove an unused string
........
  r69829 | benjamin.peterson | 2009-02-20 20:02:28 -0600 (Fri, 20 Feb 2009) | 1 line

  this assertions makes more sense here
........
  r69830 | benjamin.peterson | 2009-02-20 20:03:04 -0600 (Fri, 20 Feb 2009) | 1 line

  PyModule_AddObject can fail; simplify this code with a macro
........
  r69839 | antoine.pitrou | 2009-02-21 12:54:01 -0600 (Sat, 21 Feb 2009) | 3 lines

  StringIO is now written entirely in C (and blazingly fast)
........
  r69841 | benjamin.peterson | 2009-02-21 14:05:40 -0600 (Sat, 21 Feb 2009) | 1 line

  split the Python implementation of io into another module and rewrite the tests to test both implementations
........
  r69842 | benjamin.peterson | 2009-02-21 14:10:00 -0600 (Sat, 21 Feb 2009) | 1 line

  closed is not a function
........
  r69843 | benjamin.peterson | 2009-02-21 14:13:04 -0600 (Sat, 21 Feb 2009) | 1 line

  fix __all__ test
........
  r69844 | benjamin.peterson | 2009-02-21 14:21:24 -0600 (Sat, 21 Feb 2009) | 1 line

  fix the rest of the Misc tests
........
  r69845 | benjamin.peterson | 2009-02-21 14:26:59 -0600 (Sat, 21 Feb 2009) | 1 line

  RawIOBase is better for FileIO
........
  r69848 | benjamin.peterson | 2009-02-21 15:33:53 -0600 (Sat, 21 Feb 2009) | 1 line

  fix some more tests broken by bag argument validation
........
  r69850 | benjamin.peterson | 2009-02-21 16:16:42 -0600 (Sat, 21 Feb 2009) | 1 line

  make the python IncrementalNewineDecoder support a None decoder
........
  r69852 | benjamin.peterson | 2009-02-21 16:36:09 -0600 (Sat, 21 Feb 2009) | 1 line

  fix a BlockingIOError.characters_written bug
........
  r69854 | benjamin.peterson | 2009-02-21 16:49:02 -0600 (Sat, 21 Feb 2009) | 1 line

  check whence
........
  r69860 | benjamin.peterson | 2009-02-21 17:42:50 -0600 (Sat, 21 Feb 2009) | 1 line

  fix some of these Misbehaving io tests
........
  r69865 | benjamin.peterson | 2009-02-21 18:59:52 -0600 (Sat, 21 Feb 2009) | 1 line

  don't use super here()
........
  r69866 | benjamin.peterson | 2009-02-21 19:05:28 -0600 (Sat, 21 Feb 2009) | 1 line

  use implementation specific classes
........
  r69868 | benjamin.peterson | 2009-02-21 22:12:05 -0600 (Sat, 21 Feb 2009) | 1 line

  use a more DRY friendly approach to injecting module contents into test classes
........
  r69872 | antoine.pitrou | 2009-02-22 13:39:45 -0600 (Sun, 22 Feb 2009) | 3 lines

  Sanitize destructor behaviour of IOBase. Now Python-defined attributes can be accessed from close().
........
  r69873 | antoine.pitrou | 2009-02-22 13:50:14 -0600 (Sun, 22 Feb 2009) | 4 lines

  Only set the internal fd after it has been checked to be valid
  (otherwise, the destructor will attempt to close it)
........
  r69885 | benjamin.peterson | 2009-02-22 15:30:14 -0600 (Sun, 22 Feb 2009) | 1 line

  convert some other tests to use both io implementations
........
  r69888 | antoine.pitrou | 2009-02-22 17:03:16 -0600 (Sun, 22 Feb 2009) | 3 lines

  Silence all exceptions when finalizing
........
  r69891 | benjamin.peterson | 2009-02-22 17:27:24 -0600 (Sun, 22 Feb 2009) | 1 line

  convert another test to test both io implementations
........
  r69892 | benjamin.peterson | 2009-02-22 17:32:15 -0600 (Sun, 22 Feb 2009) | 1 line

  help poor people like me to find their io tests (did I miss any?)
........
  r69893 | benjamin.peterson | 2009-02-22 17:37:56 -0600 (Sun, 22 Feb 2009) | 1 line

  put a big note in the test telling people to write tests for both implementations now
........
  r69911 | antoine.pitrou | 2009-02-23 13:57:18 -0600 (Mon, 23 Feb 2009) | 3 lines

  expose DEFAULT_BUFFER_SIZE again (fixes a bunch of test failures)
........
  r69913 | antoine.pitrou | 2009-02-23 14:10:30 -0600 (Mon, 23 Feb 2009) | 4 lines

  Do the cyclic garbage collection tests only on the C version.
  The Python version is helpless as it uses __del__.
........
  r69914 | antoine.pitrou | 2009-02-23 14:21:41 -0600 (Mon, 23 Feb 2009) | 3 lines

  Adapt test_largefile to test both implementations
........
  r69915 | antoine.pitrou | 2009-02-23 14:25:14 -0600 (Mon, 23 Feb 2009) | 3 lines

  One small failure
........
  r69916 | antoine.pitrou | 2009-02-23 14:28:33 -0600 (Mon, 23 Feb 2009) | 3 lines

  Add a comment, at BP's request
........
  r69963 | antoine.pitrou | 2009-02-25 09:42:59 -0600 (Wed, 25 Feb 2009) | 3 lines

  Add a test of ABC inheritance
........
  r70033 | antoine.pitrou | 2009-02-27 15:49:50 -0600 (Fri, 27 Feb 2009) | 3 lines

  The base classes now are ABCs.
........
  r70035 | benjamin.peterson | 2009-02-27 15:57:41 -0600 (Fri, 27 Feb 2009) | 1 line

  good house keeping
........
  r70038 | antoine.pitrou | 2009-02-27 17:05:23 -0600 (Fri, 27 Feb 2009) | 4 lines

  Make the buffer allocation overflow tests specific to the C implementation, since the Python implementation resizes its buffers when needed rather than allocating them up front.
........
  r70041 | benjamin.peterson | 2009-02-27 18:26:12 -0600 (Fri, 27 Feb 2009) | 1 line

  kill java naming for sanity
........
  r70042 | benjamin.peterson | 2009-02-27 18:28:53 -0600 (Fri, 27 Feb 2009) | 2 lines

  timingTest is superseded by iobench
........
  r70043 | antoine.pitrou | 2009-02-27 19:13:50 -0600 (Fri, 27 Feb 2009) | 3 lines

  Remove the last traces of java naming in test_io
........
  r70044 | antoine.pitrou | 2009-02-27 19:18:34 -0600 (Fri, 27 Feb 2009) | 3 lines

  Better resource cleanup
........
  r70045 | antoine.pitrou | 2009-02-27 19:29:00 -0600 (Fri, 27 Feb 2009) | 3 lines

  Remove dubious uses of super(), and fix one test
........
  r70046 | antoine.pitrou | 2009-02-27 19:31:00 -0600 (Fri, 27 Feb 2009) | 3 lines

  Bump up CHUNK_SIZE (no need to make the Python version look slower than it is)
........
  r70047 | benjamin.peterson | 2009-02-27 20:03:26 -0600 (Fri, 27 Feb 2009) | 1 line

  fix typo
........
  r70048 | benjamin.peterson | 2009-02-27 21:35:11 -0600 (Fri, 27 Feb 2009) | 1 line

  move code to a better place
........
  r70067 | benjamin.peterson | 2009-02-28 10:43:20 -0600 (Sat, 28 Feb 2009) | 4 lines

  1. make sure to undo buffered read aheads in BufferedRandom.seek()
  2. refill the buffer if have <= 0
  3. fix the last failing test_io test!
........
  r70068 | benjamin.peterson | 2009-02-28 10:57:50 -0600 (Sat, 28 Feb 2009) | 1 line

  define read1() on the python implementation's BufferedIOBase
........
  r70069 | benjamin.peterson | 2009-02-28 11:01:17 -0600 (Sat, 28 Feb 2009) | 1 line

  document read1() in BufferedIOBase
........
  r70070 | benjamin.peterson | 2009-02-28 11:06:42 -0600 (Sat, 28 Feb 2009) | 1 line

  give credit where credit is due
........
  r70075 | antoine.pitrou | 2009-02-28 13:34:59 -0600 (Sat, 28 Feb 2009) | 3 lines

  Amaury's name
........
  r70112 | antoine.pitrou | 2009-03-02 17:11:55 -0600 (Mon, 02 Mar 2009) | 4 lines

  Looks like this is necessary in order to build cleanly under Windows
  (someone correct this if it's wrong, I'm no Windows user)
........
  r70133 | benjamin.peterson | 2009-03-03 15:23:32 -0600 (Tue, 03 Mar 2009) | 1 line

  fix test_newline_property on _pyio.StringIO
........
  r70135 | benjamin.peterson | 2009-03-03 15:47:30 -0600 (Tue, 03 Mar 2009) | 1 line

  fix typos and inconsistencies. thanks to Daniel Diniz
........
  r70140 | benjamin.peterson | 2009-03-03 16:21:10 -0600 (Tue, 03 Mar 2009) | 1 line

  add the test from #5266
........
2009-03-04 00:14:51 +00:00
Antoine Pitrou b353c12a9c Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding. 2009-02-11 00:39:14 +00:00
Antoine Pitrou 08838b6acf Merged revisions 68835 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines

  Issue #5008: When a file is opened in append mode with the new IO library,
  do an explicit seek to the end of file (so that e.g. tell() returns the
  file size rather than 0). This is consistent with the behaviour of the
  traditional 2.x file object.
........
2009-01-21 00:55:13 +00:00
Antoine Pitrou c10c34d6cb Make test_io faster 2009-01-17 02:40:13 +00:00
Antoine Pitrou 8043cf868c Issue #4604: Some objects of the I/O library could still be used after
having been closed (for instance, a read() call could return some
previously buffered data). Patch by Dmitry Vasiliev.
2009-01-09 19:54:29 +00:00
Antoine Pitrou c3b39245a7 Issue #4580: slicing of memoryviews when itemsize != 1 is wrong.
Also fix len() to return number of items rather than length in bytes.

I'm sorry it was not possible for me to work on this without reindenting
a bit some stuff around. The indentation in memoryobject.c is a mess,
I'll open a separate bug for it.
2009-01-03 16:59:18 +00:00