mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Support trailing dots in DNS names. Fixes #782510. Will backport to 2.3.
This commit is contained in:
parent
8db4403a76
commit
0d8e16c7ad
2 changed files with 19 additions and 3 deletions
|
@ -524,6 +524,10 @@ class UnicodeTest(
|
|||
# * strict decoding testing for all of the
|
||||
# UTF8_ERROR cases in PyUnicode_DecodeUTF8
|
||||
|
||||
def test_codecs_idna(self):
|
||||
# Test whether trailing dot is preserved
|
||||
self.assertEqual(u"www.python.org.".encode("idna"), "www.python.org.")
|
||||
|
||||
def test_codecs_errors(self):
|
||||
# Error handling (encoding)
|
||||
self.assertRaises(UnicodeError, u'Andr\202 x'.encode, 'ascii')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue