[Python-checkins] r42991 - in python/branches/release24-maint: Lib/test/test_multibytecodec.py Misc/NEWS Modules/cjkcodecs/_codecs_iso2022.c
hyeshik.chang
python-checkins at python.org
Mon Mar 13 11:24:42 CET 2006
Author: hyeshik.chang
Date: Mon Mar 13 11:24:31 2006
New Revision: 42991
Modified:
python/branches/release24-maint/Lib/test/test_multibytecodec.py
python/branches/release24-maint/Misc/NEWS
python/branches/release24-maint/Modules/cjkcodecs/_codecs_iso2022.c
Log:
Backport from trunk r42989:
Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
SS2 (single-shift 2) escape sequences correctly.
Modified: python/branches/release24-maint/Lib/test/test_multibytecodec.py
==============================================================================
--- python/branches/release24-maint/Lib/test/test_multibytecodec.py (original)
+++ python/branches/release24-maint/Lib/test/test_multibytecodec.py Mon Mar 13 11:24:31 2006
@@ -75,9 +75,16 @@
wr.write('abcd')
self.assertEqual(s.getvalue(), 'abcd')
+class Test_ISO2022(unittest.TestCase):
+ def test_g2(self):
+ iso2022jp2 = '\x1b(B:hu4:unit\x1b.A\x1bNi de famille'
+ uni = u':hu4:unit\xe9 de famille'
+ self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
+
def test_main():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Test_StreamWriter))
+ suite.addTest(unittest.makeSuite(Test_ISO2022))
test_support.run_suite(suite)
if __name__ == "__main__":
Modified: python/branches/release24-maint/Misc/NEWS
==============================================================================
--- python/branches/release24-maint/Misc/NEWS (original)
+++ python/branches/release24-maint/Misc/NEWS Mon Mar 13 11:24:31 2006
@@ -57,6 +57,9 @@
Extension Modules
-----------------
+- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
+ SS2 (single-shift 2) escape sequences correctly.
+
- Bug #854823: socketmodule now builds on Sun platforms even when
INET_ADDRSTRLEN is not defined.
Modified: python/branches/release24-maint/Modules/cjkcodecs/_codecs_iso2022.c
==============================================================================
--- python/branches/release24-maint/Modules/cjkcodecs/_codecs_iso2022.c (original)
+++ python/branches/release24-maint/Modules/cjkcodecs/_codecs_iso2022.c Mon Mar 13 11:24:31 2006
@@ -415,7 +415,7 @@
(*inbuf) += 3;
*inleft -= 3;
(*outbuf) += 1;
- *outbuf -= 1;
+ *outleft -= 1;
return 0;
}
More information about the Python-checkins
mailing list