| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Fix a path to an assert in fileio_read().
Some misc tweaks.
|
|
|
|
|
|
|
|
|
| |
recv()) now return bytes, not str or str8. The socket.py code is
redone; it now subclasses _socket.socket and instead of having its own
_fileobject for makefile(), it uses io.SocketIO. Some stuff in io.py
was moved around to make this work. (I really need to rethink my
policy regarding readline() and read(-1) on raw files; and readline()
on buffered files ought to use peeking(). Later.)
|
|
|
|
|
|
|
|
| |
Changes to io.py, necessary to make this work:
- Redid io.StringIO as a TextIOWrapper on top of a BytesIO instance.
- Got rid of _MemoryIOMixin, folding it into BytesIO instead.
- The read() functions that take -1 to mean "eveything" now also take None.
- Added readline() support to BufferedIOBase. :-(
|
| |
|
|
|
|
|
|
|
|
|
| |
encoding) which makes the buffer mutable. Strings are encoded on the way in
and decoded on the way out.
Use io.StringIO in test_codecs.py.
Fix the base64_codec test in test_codecs.py.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Don't read more than one line when reading text from a tty device.
Add peek() and read1() methods.
Return str instead of unicode when return ASCII characters in text mode.
|
|
|
|
|
|
| |
Fix the truncate() semantics -- it should not affect the current position.
Switch wave.py/chunk.py to struct.unpack_from() to support bytes.
Don't use writelines() on binary files (test_fileinput.py).
|
|
|
|
| |
not the number of array elements.
|
|
|
|
|
| |
- 25% speed increse in tell();
- f.seek(0, 1) now maps to f.seek(f.tell(), 0) instead of to f.tell().
|
| |
|
|
|
|
| |
call self.buffer.tell().
|
|
|
|
|
| |
Restore complex pickling.
Use cPickle in io.py.
|
|
|
|
|
| |
There is somewhat working (but slow) code supporting seek/tell for text files,
but extensive testing exposes a bug I can't nail down.
|
|
|
|
|
|
|
|
| |
write() returns the number of bytes/characters written/buffered.
FileIO.close() calls self.flush().
Implement readinto() for buffered readers.
Tests th check all these.
Test proper behavior of __enter__/__exit__.
|
|
|
|
| |
Etc., etc.
|
| |
|
|
|
|
|
|
| |
Removed unused _PyFileIO class.
Changed inheritance structure.
TODO: do the same kinds of things to TextIO.
|
|
|
|
|
|
|
|
|
| |
Add closed attribute.
Support int argument to open() -- wrapping a file descriptor.
For b/w compat, support readline(n).
Support readlines() and readlines(n).
Flush on __del__.
Added some XXX comments.
|
|
|
|
|
| |
This now appears to work when io.open is substituted for the real open
in fileinput.py -- at least the latter's unit tests pass.
|
|
|
|
|
| |
Some cleanup of test_io.py and io.py.
Added seeking to buffered reader and writer, but no tests yet.
|
| |
|
|
|
|
| |
This is essentially a checkpoint.
|
|
|
|
| |
_seekable.
|
| |
|
| |
|
|
|
|
|
|
| |
(see SF#1671314) with small tweaks.
The io module now uses this instead of its own implementation
of the FileIO class, if it can import _fileio.
|
|
|
|
| |
the amount of data read.
|
|
|
|
|
|
|
| |
I cleaned up whitespace but otherwise didn't change it.
This will need work to reflect the tentative decision to drop nonblocking I/O
support from the buffering layers.
|
|
|
|
|
|
| |
Also implemented Neal's suggestion (add fileno() to SocketIO)
and some unrelated changes, e.g. remove Google copyright
and make BytesIO a subclass of BufferedIOBase.
|
| |
|
| |
|
|
|