Skip to content

Commit

Permalink
Merged revisions 79780 via svnmerge from
Browse files Browse the repository at this point in the history
svn+ssh://[email protected]/python/branches/py3k

................
  r79780 | philip.jenvey | 2010-04-04 20:05:24 -0700 (Sun, 04 Apr 2010) | 9 lines

  Merged revisions 79779 via svnmerge from
  svn+ssh://[email protected]/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
  ........
................
  • Loading branch information
pjenvey committed Jun 9, 2010
1 parent a57aae7 commit ddf0d03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ def test_encode_length(self):
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.
Expand Down
2 changes: 2 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ C-API
Library
-------

- Fix codecs.escape_encode to return the correct consumed size.

- Issue #8897: Fix sunau module, use bytes to write the header. Patch written
by Thomas Jollans.

Expand Down
2 changes: 1 addition & 1 deletion Modules/_codecsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ escape_encode(PyObject *self,
}
}

return codec_tuple(v, PyBytes_Size(v));
return codec_tuple(v, size);
}

/* --- Decoder ------------------------------------------------------------ */
Expand Down

0 comments on commit ddf0d03

Please sign in to comment.