[Python-checkins] cpython: Issue #22682: Added support for the kz1048 encoding.

serhiy.storchaka python-checkins at python.org
Tue May 12 22:24:41 CEST 2015


https://hg.python.org/cpython/rev/6e1fe5bfba48
changeset:   95989:6e1fe5bfba48
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Tue May 12 23:16:55 2015 +0300
summary:
  Issue #22682: Added support for the kz1048 encoding.

files:
  Doc/library/codecs.rst     |  4 ++++
  Doc/whatsnew/3.5.rst       |  3 +++
  Lib/encodings/aliases.py   |  5 +++++
  Lib/locale.py              |  1 +
  Lib/test/test_codecs.py    |  1 +
  Lib/test/test_unicode.py   |  4 ++--
  Lib/test/test_xml_etree.py |  2 +-
  Misc/NEWS                  |  2 ++
  8 files changed, 19 insertions(+), 3 deletions(-)


diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -1162,6 +1162,10 @@
 +-----------------+--------------------------------+--------------------------------+
 | koi8_u          |                                | Ukrainian                      |
 +-----------------+--------------------------------+--------------------------------+
+| kz1048          | kz_1048, strk1048_2002, rk1048 | Kazakh                         |
+|                 |                                |                                |
+|                 |                                | .. versionadded:: 3.5          |
++-----------------+--------------------------------+--------------------------------+
 | mac_cyrillic    | maccyrillic                    | Bulgarian, Byelorussian,       |
 |                 |                                | Macedonian, Russian, Serbian   |
 +-----------------+--------------------------------+--------------------------------+
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -231,6 +231,9 @@
 * The :option:`-b` option now affects comparisons of :class:`bytes` with
   :class:`int`.  (Contributed by Serhiy Storchaka in :issue:`23681`)
 
+* New Kazakh :ref:`codec <standard-encodings>` ``kz1048``.  (Contributed by
+  Serhiy Storchaka in :issue:`22682`.)
+
 
 New Modules
 ===========
diff --git a/Lib/encodings/aliases.py b/Lib/encodings/aliases.py
--- a/Lib/encodings/aliases.py
+++ b/Lib/encodings/aliases.py
@@ -412,6 +412,11 @@
     # koi8_r codec
     'cskoi8r'            : 'koi8_r',
 
+    # kz1048 codec
+    'kz_1048'           : 'kz1048',
+    'rk1048'            : 'kz1048',
+    'strk1048_2002'     : 'kz1048',
+
     # latin_1 codec
     #
     # Note that the latin_1 codec is implemented internally in C and a
diff --git a/Lib/locale.py b/Lib/locale.py
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -700,6 +700,7 @@
     'utf_8':                        'UTF-8',
     'koi8_r':                       'KOI8-R',
     'koi8_u':                       'KOI8-U',
+    'kz1048':                       'RK1048',
     'cp1251':                       'CP1251',
     'cp1255':                       'CP1255',
     'cp1256':                       'CP1256',
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -1823,6 +1823,7 @@
     "johab",
     "koi8_r",
     "koi8_u",
+    "kz1048",
     "latin_1",
     "mac_cyrillic",
     "mac_greek",
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -2081,7 +2081,7 @@
             'cp863', 'cp865', 'cp866', 'cp1125',
             'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
             'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6',
-            'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1',
+            'iso8859_7', 'iso8859_9', 'koi8_r', 'kz1048', 'latin_1',
             'mac_cyrillic', 'mac_latin2',
 
             'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
@@ -2116,7 +2116,7 @@
             #'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
             #'cp1256', 'cp1257', 'cp1258',
             #'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
-            #'iso8859_3', 'iso8859_6', 'iso8859_7',
+            #'iso8859_3', 'iso8859_6', 'iso8859_7', 'kz1048',
             #'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
 
             ### These fail the round-trip:
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -704,7 +704,7 @@
             'mac-roman', 'mac-turkish',
             'iso2022-jp', 'iso2022-jp-1', 'iso2022-jp-2', 'iso2022-jp-2004',
             'iso2022-jp-3', 'iso2022-jp-ext',
-            'koi8-r', 'koi8-u',
+            'koi8-r', 'koi8-u', 'kz1048',
             'hz', 'ptcp154',
         ]
         for encoding in supported_encodings:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,8 @@
 Library
 -------
 
+- Issue #22682: Added support for the kz1048 encoding.
+
 - Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
   if they called on a closed object. Patch by John Hergenroeder.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list