Commit graph

24500 commits

Author SHA1 Message Date
Guido van Rossum
ad7d8d10b7 Rough and dirty job -- allow concatenation of bytes and arbitrary
buffer-supporting objects (Unicode always excluded), and also of
str and bytes.
(For some reason u"" + b"" doesn't fail, I'll investigate later.)
2007-04-13 01:39:34 +00:00
Guido van Rossum
dc0b1a1069 Make a few more tests pass with the new I/O library.
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).
2007-04-12 22:55:07 +00:00
Guido van Rossum
682faf8fe0 Fix most XXX remarks. 2007-04-12 14:56:58 +00:00
Guido van Rossum
31c3a57480 Test closed, mode attribute; don't test __exit__(). 2007-04-12 14:51:49 +00:00
Walter Dörwald
4234827e99 Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
first chunk fed to the decoder started with a BOM, but was longer than 3 bytes.
2007-04-12 10:35:00 +00:00
Žiga Seilnacht
9aba6d6905 Patch #1695862: remove the cleanup code, now that Windows buildbots are green
again.
2007-04-12 08:46:51 +00:00
Guido van Rossum
d410395ea7 Make sure that writing an array instance returns the number of bytes,
not the number of array elements.
2007-04-12 05:44:49 +00:00
Raymond Hettinger
4db5fe970c SF 1193128: Let str.translate(None) be an identity transformation 2007-04-12 04:10:00 +00:00
Georg Brandl
57b39e0916 Bug #1697782: remove all remaining code that uses types.InstanceType. 2007-04-11 19:24:50 +00:00
Raymond Hettinger
13936697f6 SF 1191699: Make slices picklable 2007-04-11 18:40:58 +00:00
Guido van Rossum
b5ddcfd2a2 Make array().tofile() work with a new I/O object. 2007-04-11 17:08:28 +00:00
Guido van Rossum
d0712817ac Re-enable cleanup code. 2007-04-11 16:32:43 +00:00
Guido van Rossum
b9c4c3e455 Speed up next() by disabling snapshot updating then. 2007-04-11 16:07:50 +00:00
Guido van Rossum
cba608cadb More efficient implementation of tell(); _read_chunk() doesn't have to
call self.buffer.tell().
2007-04-11 14:19:59 +00:00
Andrew M. Kuchling
400a49ba79 Add window.chgat() method, submitted via e-mail by Fabian Kreutz 2007-04-11 13:39:00 +00:00
Guido van Rossum
0ad0812edb An example of action-at-a-distance: fix the problems I had in test_io.py
without touching io.py or test_io.py.  The cause of the failure was that
bytes objects didn't pickle right.  As a stop-gap measure, I'm providing
bytes pickling via copy_reg.  Eventually, we should use a more efficient
protocol, e.g. __reduce_ex__ or __getstate__/__setstate__.
2007-04-11 04:37:43 +00:00
Guido van Rossum
9b76da6a8f Checkpoint so I can continue to work on this at a different box.
There is somewhat working (but slow) code supporting seek/tell for text files,
but extensive testing exposes a bug I can't nail down.
2007-04-11 01:09:03 +00:00
Guido van Rossum
8742977b33 truncate() returns the new size and position.
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__.
2007-04-10 21:06:59 +00:00
Guido van Rossum
34d69e57e3 Skip large file tests on Windowns and OSX.
Reduce large file size to 2**31 (and a bit).
2007-04-10 20:08:41 +00:00
Guido van Rossum
53807dabf0 Implement long positioning (Unix only, probably).
Etc., etc.
2007-04-10 19:01:47 +00:00
Collin Winter
8341aac123 Typo fix. 2007-04-10 04:44:49 +00:00
Facundo Batista
3bdc002e39 Minor fix to the tests pass ok even with -O. 2007-04-10 03:00:37 +00:00
Guido van Rossum
141f767d46 More cleanup. Renamed BlockingIO to BlockingIOError.
Removed unused _PyFileIO class.
Changed inheritance structure.
TODO: do the same kinds of things to TextIO.
2007-04-10 00:22:16 +00:00
Žiga Seilnacht
d5b3fed17d Patch #1695862: remove old test directory that causes test_urllib failures
on Windows buildbots.  The change is a one time fix and will be removed
after a successful buildbot run.
2007-04-09 19:10:29 +00:00
Guido van Rossum
ebea9beab3 Bytes should never equal unicode.
Add tests for str <cmpop> bytes.
2007-04-09 00:49:13 +00:00
Guido van Rossum
343e97ff7f For Make Benefit Glorious Nation of Backwards Compatibility,
bytes objects can now be compared to anything that supports the buffer API.
2007-04-09 00:43:24 +00:00
Guido van Rossum
62cbc8a261 Make sure that a forked child process exits even if it raises an exception. 2007-04-09 00:41:25 +00:00
Guido van Rossum
933520b5ba Fix a place where it's pretty clear that a binary open mode was intended.
(The new I/O library revealed the problem.)
2007-04-09 00:00:23 +00:00
Collin Winter
bf61856427 Convert test_fileinput to use unittest. 2007-04-07 04:40:43 +00:00
Collin Winter
69c955f05d Convert test_module to use unittest. 2007-04-06 20:03:11 +00:00
Collin Winter
fef1dcf433 Convert test_gc to use unittest. 2007-04-06 20:00:05 +00:00
Collin Winter
e10deca7e0 Import cleanup in test_crypt. 2007-04-06 19:32:32 +00:00
Collin Winter
1dd9a2ccc3 Convert test_stringprep to use unittest. 2007-04-06 19:27:40 +00:00
Guido van Rossum
76c5d4d72d Checkpoint.
Some cleanup of test_io.py and io.py.
Added seeking to buffered reader and writer, but no tests yet.
2007-04-06 19:10:29 +00:00
Guido van Rossum
78892e4613 Added a working Text I/O layer, by Mark Russell.
This is essentially a checkpoint.
2007-04-06 17:31:18 +00:00
Collin Winter
9405609c17 Convert test_normalization to use unittest. 2007-04-05 20:08:56 +00:00
Collin Winter
fe712fb9ca Convert test_long_future to use unittest. 2007-04-05 20:05:07 +00:00
Raymond Hettinger
7a3d41f4ca Bug #1563759: struct.unpack doens't support buffer protocol objects 2007-04-05 18:00:03 +00:00
Raymond Hettinger
3608f0570e Bug #1563759: struct.unpack doens't support buffer protocol objects 2007-04-04 20:32:03 +00:00
Žiga Seilnacht
18ffe42b4b Fix WalkTests.test_traversal() on Windows. The cleanup in
MakedirTests.setUp() can now be removed.
2007-04-04 18:38:47 +00:00
Collin Winter
10fe455529 Make test_softspace use unittest. 2007-04-04 18:36:30 +00:00
Collin Winter
82c3671565 Make test_getopt use unittest. 2007-04-04 18:33:40 +00:00
Martin v. Löwis
8863544522 Bug #1686475: Support stat'ing open files on Windows again. 2007-04-04 18:30:56 +00:00
Martin v. Löwis
3bf573f918 Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
2007-04-04 18:30:36 +00:00
Collin Winter
80e8c998a2 Stop using test_support.verify(). 2007-04-04 18:16:24 +00:00
Collin Winter
9475db7662 Clean up imports. 2007-04-04 18:14:17 +00:00
Guido van Rossum
b1bb01e2f6 Fix a race condition in this test -- instead of assuming that it will take
the test server thread at most 0.5 seconds to get ready, use an event
variable.
2007-04-04 17:43:02 +00:00
Facundo Batista
06c6579036 Fixed the way that the .pem files are looked for, and changed
how to kill the process in win32 to use the _handle attribute.
2007-04-04 14:10:40 +00:00
Facundo Batista
a0da5c7bce Changed the whole structure of startup and checking if the
server is available. Hope to not get more false alarms.
2007-04-03 21:15:34 +00:00
Walter Dörwald
e6dae6c655 Implement a contextmanager test.test_support.catch_warning that can
be used to catch the last warning issued by the warning framework.

Change test_warnings.py and test_structmembers.py to use this
new contextmanager.
2007-04-03 18:33:29 +00:00