mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged revisions 74929 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74929 | benjamin.peterson | 2009-09-18 16:14:55 -0500 (Fri, 18 Sep 2009) | 1 line add keyword arguments support to str/unicode encode and decode #6300 ........
This commit is contained in:
parent
7a4e5866f7
commit
308d637c94
7 changed files with 29 additions and 13 deletions
|
@ -955,6 +955,10 @@ class UnicodeTest(
|
|||
self.assertRaises(UnicodeError, 'Andr\202 x'.encode, 'ascii','strict')
|
||||
self.assertEqual('Andr\202 x'.encode('ascii','ignore'), b"Andr x")
|
||||
self.assertEqual('Andr\202 x'.encode('ascii','replace'), b"Andr? x")
|
||||
self.assertEqual('Andr\202 x'.encode('ascii', 'replace'),
|
||||
'Andr\202 x'.encode('ascii', errors='replace'))
|
||||
self.assertEqual('Andr\202 x'.encode('ascii', 'ignore'),
|
||||
'Andr\202 x'.encode(encoding='ascii', errors='ignore'))
|
||||
|
||||
# Error handling (decoding)
|
||||
self.assertRaises(UnicodeError, str, b'Andr\202 x', 'ascii')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue