mirror of
https://github.com/python/cpython.git
synced 2025-11-08 17:41:42 +00:00
fix escape_encode to return the correct consumed size
This commit is contained in:
parent
dd194ab37b
commit
034b0acdd3
2 changed files with 8 additions and 4 deletions
|
|
@ -835,6 +835,9 @@ def test_encode_length(self):
|
|||
self.assertEquals(encoder(u"a")[1], 1)
|
||||
self.assertEquals(encoder(u"\xe9\u0142")[1], 2)
|
||||
|
||||
encoder = codecs.getencoder("string-escape")
|
||||
self.assertEquals(encoder(r'\x00')[1], 4)
|
||||
|
||||
# From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
|
||||
nameprep_tests = [
|
||||
# 3.1 Map to nothing.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue