Commit 66a1bd55 authored by Philip Jenvey's avatar Philip Jenvey

Merged revisions 79779 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79779 | philip.jenvey | 2010-04-04 19:51:51 -0700 (Sun, 04 Apr 2010) | 2 lines

  fix escape_encode to return the correct consumed size
........
parent cfe0af4c
...@@ -905,6 +905,8 @@ class UnicodeInternalTest(unittest.TestCase): ...@@ -905,6 +905,8 @@ class UnicodeInternalTest(unittest.TestCase):
self.assertEquals(encoder("a")[1], 1) self.assertEquals(encoder("a")[1], 1)
self.assertEquals(encoder("\xe9\u0142")[1], 2) self.assertEquals(encoder("\xe9\u0142")[1], 2)
self.assertEquals(codecs.escape_encode(br'\x00')[1], 4)
# From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html # From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
nameprep_tests = [ nameprep_tests = [
# 3.1 Map to nothing. # 3.1 Map to nothing.
......
...@@ -217,7 +217,7 @@ escape_encode(PyObject *self, ...@@ -217,7 +217,7 @@ escape_encode(PyObject *self,
} }
} }
return codec_tuple(v, PyBytes_Size(v)); return codec_tuple(v, size);
} }
/* --- Decoder ------------------------------------------------------------ */ /* --- Decoder ------------------------------------------------------------ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment