summaryrefslogtreecommitdiff
path: root/Lib/io.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-05-03 12:21:13 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-05-03 12:21:13 +0000
commit7684f852972901b2e55be898f316095c3acf51bc (patch)
treefa855aa9dfa7817548b203d1169b31a0e6d26719 /Lib/io.py
parent64a4bbeb259026e6bb3e4a8864870b1ed35ffab2 (diff)
downloadcpython-git-7684f852972901b2e55be898f316095c3acf51bc.tar.gz
In test_io, StatefulIncrementalDecoderTest was not part of the test suite.
And of course, the test failed: a bytearray was used without reason in io.TextIOWrapper.tell(). The difference is that iterating over bytes (i.e. str in python2.6) returns 1-char bytes, whereas bytearrays yield integers. This code should still work with python3.0
Diffstat (limited to 'Lib/io.py')
-rw-r--r--Lib/io.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 213b0fc760..ec594487a9 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -1528,8 +1528,7 @@ class TextIOWrapper(TextIOBase):
# nearest "safe start point" before the current location
# (a point where the decoder has nothing buffered, so seek()
# can safely start from there and advance to this location).
- next_byte = bytearray(1)
- for next_byte[0] in next_input:
+ for next_byte in next_input:
bytes_fed += 1
chars_decoded += len(decoder.decode(next_byte))
dec_buffer, dec_flags = decoder.getstate()