]> granicus.if.org Git - python/commitdiff
Fix and enable a skipped test:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Tue, 1 Apr 2008 22:37:33 +0000 (22:37 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Tue, 1 Apr 2008 22:37:33 +0000 (22:37 +0000)
with python 2.6, enumerating bytes yields 1-char strings, not numbers.

Don't merge this into the py3k branch.

Lib/test/test_io.py

index e26b7083e75bd1b0b640557c0b8859a3532b4ef3..39d3e5b00bd9259157abcc0a002f7ba3b8c9a8c6 100644 (file)
@@ -545,7 +545,7 @@ class StatefulIncrementalDecoder(codecs.IncrementalDecoder):
         output = ''
         for b in input:
             if self.i == 0: # variable-length, terminated with period
-                if b == ord('.'):
+                if b == '.':
                     if self.buffer:
                         output += self.process_word()
                 else:
@@ -560,9 +560,9 @@ class StatefulIncrementalDecoder(codecs.IncrementalDecoder):
 
     def process_word(self):
         output = ''
-        if self.buffer[0] == ord('i'):
+        if self.buffer[0] == 'i':
             self.i = min(99, int(self.buffer[1:] or 0)) # set input length
-        elif self.buffer[0] == ord('o'):
+        elif self.buffer[0] == 'o':
             self.o = min(99, int(self.buffer[1:] or 0)) # set output length
         else:
             output = self.buffer.decode('ascii')
@@ -895,8 +895,7 @@ class TextIOWrapperTest(unittest.TestCase):
         f.readline()
         f.tell()
 
-    # FIXME: figure out why the test fails with Python 2.6
-    def XXXtestSeekAndTell(self):
+    def testSeekAndTell(self):
         """Test seek/tell using the StatefulIncrementalDecoder."""
 
         def lookupTestDecoder(name):