summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecs.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #14579: Fix CVE-2012-2135: vulnerability in the utf-16 decoder after ↵Antoine Pitrou2012-07-201-4/+26
| | | | | | error handling. Patch by Serhiy Storchaka.
* Backport 0398f07d4827 (fix for weird buildbot failures)Antoine Pitrou2011-07-261-1/+1
|
* Issue #1813: Fix codec lookup under Turkish locales.Antoine Pitrou2011-07-241-0/+14
|
* Merge 3.1Victor Stinner2011-05-231-7/+6
|\
| * test_codecs now removes the temporay file (created by the test)Victor Stinner2011-05-231-7/+6
| |
| * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-81/+81
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
| * Merged revisions 81908 via svnmerge fromAntoine Pitrou2010-06-111-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81908 | antoine.pitrou | 2010-06-11 23:46:32 +0200 (ven., 11 juin 2010) | 11 lines Merged revisions 81907 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81907 | antoine.pitrou | 2010-06-11 23:42:26 +0200 (ven., 11 juin 2010) | 5 lines Issue #8941: decoding big endian UTF-32 data in UCS-2 builds could crash the interpreter with characters outside the Basic Multilingual Plane (higher than 0x10000). ........ ................
| * Merged revisions 79780 via svnmerge fromPhilip Jenvey2010-06-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r79780 | philip.jenvey | 2010-04-04 20:05:24 -0700 (Sun, 04 Apr 2010) | 9 lines Merged revisions 79779 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r79779 | philip.jenvey | 2010-04-04 19:51:51 -0700 (Sun, 04 Apr 2010) | 2 lines fix escape_encode to return the correct consumed size ........ ................
| * Merged revisions 81474 via svnmerge fromVictor Stinner2010-05-221-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81474 | victor.stinner | 2010-05-22 18:59:09 +0200 (sam., 22 mai 2010) | 20 lines Merged revisions 81471-81472 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81471 | victor.stinner | 2010-05-22 15:37:56 +0200 (sam., 22 mai 2010) | 7 lines Issue #6268: More bugfixes about BOM, UTF-16 and UTF-32 * Fix seek() method of codecs.open(), don't write the BOM twice after seek(0) * Fix reset() method of codecs, UTF-16, UTF-32 and StreamWriter classes * test_codecs: use "w+" mode instead of "wt+". "t" mode is not supported by Solaris or Windows, but does it really exist? I found it the in the issue. ........ r81472 | victor.stinner | 2010-05-22 15:44:25 +0200 (sam., 22 mai 2010) | 4 lines Fix my last commit (r81471) about codecs Rememder: don't touch the code just before a commit ........ ................
| * Merged revisions 81461 via svnmerge fromVictor Stinner2010-05-221-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81461 | victor.stinner | 2010-05-22 04:16:27 +0200 (sam., 22 mai 2010) | 10 lines Merged revisions 81459 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81459 | victor.stinner | 2010-05-22 04:11:07 +0200 (sam., 22 mai 2010) | 3 lines Issue #6268: Fix seek() method of codecs.open(), don't read the BOM twice after seek(0) ........ ................
| * Merged revisions 80382 via svnmerge fromVictor Stinner2010-04-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r80382 | victor.stinner | 2010-04-22 21:38:16 +0200 (jeu., 22 avril 2010) | 3 lines Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing unicode string (eg. backslashreplace) ........
| * Recorded merge of revisions 78462,78484 via svnmerge fromFlorent Xicluna2010-02-271-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78462 | florent.xicluna | 2010-02-26 12:12:33 +0100 (ven, 26 fév 2010) | 9 lines Merged revisions 78461 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78461 | florent.xicluna | 2010-02-26 11:40:58 +0100 (ven, 26 fév 2010) | 2 lines #691291: codecs.open() should not convert end of lines on reading and writing. ........ ................ r78484 | florent.xicluna | 2010-02-27 12:31:21 +0100 (sam, 27 fév 2010) | 9 lines Merged revisions 78482 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78482 | florent.xicluna | 2010-02-27 12:19:18 +0100 (sam, 27 fév 2010) | 2 lines Add entry for issue #691291. ........ ................
| * Merged revisions 74871 via svnmerge fromGeorg Brandl2009-09-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ................ r74871 | georg.brandl | 2009-09-17 13:41:24 +0200 (Do, 17 Sep 2009) | 12 lines Merged revisions 74869 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk (Only the new tests, the code had already been corrected due to an API change in unicode_decode_call_errorhandler.) ........ r74869 | georg.brandl | 2009-09-17 13:28:09 +0200 (Do, 17 Sep 2009) | 4 lines Issue #6922: Fix an infinite loop when trying to decode an invalid UTF-32 stream with a non-raising error handler like "replace" or "ignore". ........ ................
| * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-5/+5
| | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
| * Merged revisions 73698 via svnmerge fromAmaury Forgeot d'Arc2009-06-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r73698 | amaury.forgeotdarc | 2009-06-30 00:36:49 +0200 (mar., 30 juin 2009) | 7 lines #6373: SystemError in str.encode('latin1', 'surrogateescape') if the string contains unpaired surrogates. (In debug build, crash in assert()) This can happen with normal processing, if python starts with utf-8, then calls sys.setfilesystemencoding('latin-1') ........
* | remove (un)transform methodsBenjamin Peterson2010-12-121-16/+3
| |
* | Issue #10546: UTF-16-LE and UTF-16-BE *do* support non-BMP charactersVictor Stinner2010-12-081-0/+12
| | | | | | | | Fix the doc and add tests.
* | #7475: add (un)transform method to bytes/bytearray and str, add back codecs ↵Georg Brandl2010-12-021-0/+62
| | | | | | | | that can be used with them from Python 2.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-81/+81
| |
* | Merged revisions 81499,81506 via svnmerge fromBenjamin Peterson2010-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81499 | georg.brandl | 2010-05-24 16:29:07 -0500 (Mon, 24 May 2010) | 1 line #8016: add the CP858 codec (approved by Benjamin). (Also add CP720 to the tests, it was missing there.) ........ r81506 | benjamin.peterson | 2010-05-24 17:04:53 -0500 (Mon, 24 May 2010) | 1 line set svn:eol-style ........
* | Issue #850997: mbcs encoding (Windows only) handles errors argument: strictVictor Stinner2010-06-161-6/+1
| | | | | | | | | | mode raises unicode errors. The encoder only supports "strict" and "replace" error handlers, the decoder only supports "strict" and "ignore" error handlers.
* | Merged revisions 81907 via svnmerge fromAntoine Pitrou2010-06-111-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81907 | antoine.pitrou | 2010-06-11 23:42:26 +0200 (ven., 11 juin 2010) | 5 lines Issue #8941: decoding big endian UTF-32 data in UCS-2 builds could crash the interpreter with characters outside the Basic Multilingual Plane (higher than 0x10000). ........
* | Issue #8838, #8339: Remove codecs.charbuffer_encode() and "t#" parsing formatVictor Stinner2010-06-081-14/+0
| | | | | | | | | | Remove last references to the "char buffer" of the buffer protocol from Python3.
* | Merged revisions 81471-81472 via svnmerge fromVictor Stinner2010-05-221-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81471 | victor.stinner | 2010-05-22 15:37:56 +0200 (sam., 22 mai 2010) | 7 lines Issue #6268: More bugfixes about BOM, UTF-16 and UTF-32 * Fix seek() method of codecs.open(), don't write the BOM twice after seek(0) * Fix reset() method of codecs, UTF-16, UTF-32 and StreamWriter classes * test_codecs: use "w+" mode instead of "wt+". "t" mode is not supported by Solaris or Windows, but does it really exist? I found it the in the issue. ........ r81472 | victor.stinner | 2010-05-22 15:44:25 +0200 (sam., 22 mai 2010) | 4 lines Fix my last commit (r81471) about codecs Rememder: don't touch the code just before a commit ........
* | Merged revisions 81459 via svnmerge fromVictor Stinner2010-05-221-0/+21
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81459 | victor.stinner | 2010-05-22 04:11:07 +0200 (sam., 22 mai 2010) | 3 lines Issue #6268: Fix seek() method of codecs.open(), don't read the BOM twice after seek(0) ........
* | Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producingVictor Stinner2010-04-221-0/+10
| | | | | | | | unicode string (eg. backslashreplace)
* | Merged revisions 79779 via svnmerge fromPhilip Jenvey2010-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79779 | philip.jenvey | 2010-04-04 19:51:51 -0700 (Sun, 04 Apr 2010) | 2 lines fix escape_encode to return the correct consumed size ........
* | Merged revisions 78461 via svnmerge fromFlorent Xicluna2010-02-261-0/+15
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78461 | florent.xicluna | 2010-02-26 11:40:58 +0100 (ven, 26 fév 2010) | 2 lines #691291: codecs.open() should not convert end of lines on reading and writing. ........
* | Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* | Merged revisions 74869 via svnmerge from ↵Georg Brandl2009-09-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk (Only the new tests, the code had already been corrected due to an API change in unicode_decode_call_errorhandler.) ........ r74869 | georg.brandl | 2009-09-17 13:28:09 +0200 (Do, 17 Sep 2009) | 4 lines Issue #6922: Fix an infinite loop when trying to decode an invalid UTF-32 stream with a non-raising error handler like "replace" or "ignore". ........
* | convert old fail* assertions to assert*Benjamin Peterson2009-06-301-5/+5
| |
* | #6373: SystemError in str.encode('latin1', 'surrogateescape')Amaury Forgeot d'Arc2009-06-291-0/+5
|/ | | | | | | | if the string contains unpaired surrogates. (In debug build, crash in assert()) This can happen with normal processing, if python starts with utf-8, then calls sys.setfilesystemencoding('latin-1')
* Rename utf8b error handler to surrogateescape.Martin v. Löwis2009-05-101-10/+10
|
* Rename the surrogates error handler to surrogatepass.Martin v. Löwis2009-05-101-6/+6
|
* Merged revisions 72404-72406 via svnmerge fromWalter Dörwald2009-05-061-2/+7
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72404 | walter.doerwald | 2009-05-06 16:28:24 +0200 (Mi, 06 Mai 2009) | 3 lines Issue 3739: The unicode-internal encoder now reports the number of *characters* consumed like any other encoder (instead of the number of bytes). ........ r72406 | walter.doerwald | 2009-05-06 16:32:35 +0200 (Mi, 06 Mai 2009) | 2 lines Add NEWS entry about issue #3739. ........
* Issue #5915: Implement PEP 383, Non-decodable Bytes inMartin v. Löwis2009-05-051-0/+29
| | | | System Character Interfaces.
* Issue #3672: Reject surrogates in utf-8 codec; add surrogates errorMartin v. Löwis2009-05-021-2/+13
| | | | handler.
* Issue #4874: Most builtin decoders now reject unicode input.Antoine Pitrou2009-01-221-0/+31
|
* Issue #2394: implement more of the memoryview API.Antoine Pitrou2008-08-191-1/+1
|
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-3/+3
|
* Merged revisions 59056-59076 via svnmerge fromChristian Heimes2007-11-201-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r59064 | christian.heimes | 2007-11-20 02:48:48 +0100 (Tue, 20 Nov 2007) | 1 line Fixed bug #1470 ........ r59066 | martin.v.loewis | 2007-11-20 03:46:02 +0100 (Tue, 20 Nov 2007) | 2 lines Patch #1468: Package Lib/test/*.pem. ........ r59068 | christian.heimes | 2007-11-20 04:21:02 +0100 (Tue, 20 Nov 2007) | 1 line Another fix for test_shutil. Martin pointed out that it breaks some build bots ........ r59073 | nick.coghlan | 2007-11-20 15:55:57 +0100 (Tue, 20 Nov 2007) | 1 line Backport some main.c cleanup from the py3k branch ........ r59076 | amaury.forgeotdarc | 2007-11-21 00:31:27 +0100 (Wed, 21 Nov 2007) | 6 lines The incremental decoder for utf-7 must preserve its state between calls. Solves issue1460. Might not be a backport candidate: a new API function was added, and some code may rely on details in utf-7.py. ........
* Merged revisions 59041-59055 via svnmerge fromGuido van Rossum2007-11-191-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r59044 | neal.norwitz | 2007-11-18 17:46:20 -0800 (Sun, 18 Nov 2007) | 1 line Use a slightly more recent version than 1.5.2b2. ........ r59047 | walter.doerwald | 2007-11-19 04:14:05 -0800 (Mon, 19 Nov 2007) | 2 lines Fix typo in comment. ........ r59049 | walter.doerwald | 2007-11-19 04:41:10 -0800 (Mon, 19 Nov 2007) | 4 lines Fix for #1444: utf_8_sig.StreamReader was (indirectly through decode()) calling codecs.utf_8_decode() with final==True, which falled with incomplete byte sequences. Fix and test by James G. Sack. ........ r59051 | nick.coghlan | 2007-11-19 05:56:27 -0800 (Mon, 19 Nov 2007) | 1 line Enable some test_cmd_line_script debugging output to investigate failure on Mac OSX buildbot ........ r59053 | facundo.batista | 2007-11-19 08:30:24 -0800 (Mon, 19 Nov 2007) | 3 lines Fixed detail in add_type() explanation (issue 1463). ........ r59054 | guido.van.rossum | 2007-11-19 09:35:24 -0800 (Mon, 19 Nov 2007) | 2 lines Make this work stand-alone, too. ........ r59055 | guido.van.rossum | 2007-11-19 09:50:22 -0800 (Mon, 19 Nov 2007) | 3 lines Fix the OSX failures in this test -- they were due to /tmp being a symlink to /private/tmp. Adding a call to os.path.realpath() to temp_dir() fixed it. ........
* Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum2007-11-061-2/+4
| | | | | | | | | | | | | | No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.
* Patch# 1258 by Christian Heimes: kill basestring.Guido van Rossum2007-10-161-2/+3
| | | | I like this because it makes the code shorter! :-)
* Fix the one failing test (can't decode twice).Guido van Rossum2007-08-291-1/+2
|
* Changes in anticipation of stricter str vs. bytes enforcement.Guido van Rossum2007-08-271-7/+7
|
* Apply SF patch #1775604: This adds three new codecs (utf-32, utf-32-le andWalter Dörwald2007-08-161-0/+140
| | | | | | | | | ut-32-be). On narrow builds the codecs combine surrogate pairs in the unicode object into one codepoint on encoding and create surrogate pairs for codepoints outside the BMP on decoding. Lone surrogates are passed through unchanged in all cases. Backport to the trunk will follow.
* Change readbuffer_encode() and charbuffer_encode() toWalter Dörwald2007-06-221-5/+5
| | | | return bytes objects.
* Patch by Ron Adam: Don't use u prefix in unicode error messagesWalter Dörwald2007-06-201-4/+4
| | | | and remove u prefix from some comments in test_codecs.py.
* Rip out all codecs that can't work in a unicode/bytes world:Walter Dörwald2007-06-121-64/+0
| | | | | | | | base64, uu, zlib, rot_13, hex, quopri, bz2, string_escape. However codecs.escape_encode() and codecs.escape_decode() still exist, as they are used for pickling str8 objects (so those two functions can go, when the str8 type is removed).