Skip to content

Commit 8897278

Browse files
committed
gh-162462: Apply Windows codec review suggestions
1 parent 4313d6a commit 8897278

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

‎Doc/library/codecs.rst‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,9 +1618,7 @@ This module implements the following functions:
16181618

16191619
.. function:: win32_code_page_search_function(encoding)
16201620

1621-
Search for a Windows code page encoding *encoding* of the form ``cpXXXX``,
1622-
where ``XXXX`` is a non-negative integer written in ASCII decimal digits
1623-
without leading zeros.
1621+
Search for a Windows code page encoding *encoding* of the form ``cpXXXX``.
16241622

16251623
If the code page is valid and supported, return a :class:`codecs.CodecInfo`
16261624
object for it.

‎Lib/test/test_codecs.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,6 +3460,7 @@ def test_lookup_code_page(self):
34603460
self.assertEqual(codecs.lookup('windows-1252').name, 'cp1252')
34613461

34623462
def test_lookup_invalid_code_page_names(self):
3463+
# gh-162462: only the canonical cpXXX spelling is accepted.
34633464
for encoding in ('cp01252', 'cp1_252', 'cp+1252', 'cp-1'):
34643465
with self.subTest(encoding=encoding):
34653466
self.assertRaises(LookupError, codecs.lookup, encoding)

0 commit comments

Comments
 (0)