[pypy-svn] r16135 - in pypy/dist/pypy/module/_codecs: . test

ale at codespeak.net ale at codespeak.net
Thu Aug 18 15:00:04 CEST 2005


Author: ale
Date: Thu Aug 18 15:00:03 2005
New Revision: 16135

Modified:
   pypy/dist/pypy/module/_codecs/app_codecs.py
   pypy/dist/pypy/module/_codecs/test/test_codecs.py
Log:
corrected some bugs (Thanks Armin)

Enabled the tests

Modified: pypy/dist/pypy/module/_codecs/app_codecs.py
==============================================================================
--- pypy/dist/pypy/module/_codecs/app_codecs.py	(original)
+++ pypy/dist/pypy/module/_codecs/app_codecs.py	Thu Aug 18 15:00:03 2005
@@ -312,20 +312,18 @@
             if data[i] == 'v':
                 res += '\v'
             if data[i] == '0':
-                octal = data[i+1:i+2]
+                octal = data[i+1:i+3]
                 res += chr(int(octal,8))
                 i += 2
             if data[i] == 'x':
-                hexa = data[i+1:i+2]
+                hexa = data[i+1:i+3]
                 res += chr(int(hexa,16))
                 i += 2
             if data[i] == 'u':
-                hexa = data[i+1:i+4]
-                res += unichr(int(hexa,16))
+                res += data[i-1:i+5]
                 i += 4
             if data[i] == 'U':
-                hexa = data[i+1:i+8]
-                res += unichr(int(hexa,16))
+                res += data[i-1:i+9]
                 i += 8
             if data[i] == 'N':
                 raise NotImplementedError

Modified: pypy/dist/pypy/module/_codecs/test/test_codecs.py
==============================================================================
--- pypy/dist/pypy/module/_codecs/test/test_codecs.py	(original)
+++ pypy/dist/pypy/module/_codecs/test/test_codecs.py	Thu Aug 18 15:00:03 2005
@@ -43,7 +43,7 @@
     def test_escape_decode(self):
         test = 'a\n\\b\x00c\td\u2045'.encode('string_escape')
         assert test.decode('string_escape') =='a\n\\b\x00c\td\u2045'
-        skip("string_escape has open bugs")
+       # skip("string_escape has open bugs")
         assert '\\077'.decode('string_escape') == '?'
         assert '\\u1234'.decode('string_escape') == '\u1234'
         assert '\\x41u1234'.decode('string_escape') == 'Au1234'



More information about the Pypy-commit mailing list