[Python-checkins] r79780 - in python/branches/py3k: Lib/test/test_codecs.py Modules/_codecsmodule.c

philip.jenvey python-checkins at python.org
Mon Apr 5 05:05:24 CEST 2010


Author: philip.jenvey
Date: Mon Apr  5 05:05:24 2010
New Revision: 79780

Log:
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
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/test/test_codecs.py
   python/branches/py3k/Modules/_codecsmodule.c

Modified: python/branches/py3k/Lib/test/test_codecs.py
==============================================================================
--- python/branches/py3k/Lib/test/test_codecs.py	(original)
+++ python/branches/py3k/Lib/test/test_codecs.py	Mon Apr  5 05:05:24 2010
@@ -905,6 +905,8 @@
         self.assertEquals(encoder("a")[1], 1)
         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
 nameprep_tests = [
     # 3.1 Map to nothing.

Modified: python/branches/py3k/Modules/_codecsmodule.c
==============================================================================
--- python/branches/py3k/Modules/_codecsmodule.c	(original)
+++ python/branches/py3k/Modules/_codecsmodule.c	Mon Apr  5 05:05:24 2010
@@ -217,7 +217,7 @@
 		}
 	}
 	
-	return codec_tuple(v, PyBytes_Size(v));
+	return codec_tuple(v, size);
 }
 
 /* --- Decoder ------------------------------------------------------------ */


More information about the Python-checkins mailing list