summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecs.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a test that checks the basic functionality of every encoding.Walter Dörwald2004-12-291-1/+179
|
* The changes to the stateful codecs in 2.4 resulted in StreamReader.readline()Walter Dörwald2004-12-211-13/+80
| | | | | | | | | | | | | | trying to return a complete line even if a size parameter was given (see http://www.python.org/sf/1076985). This leads to buffer overflows with long source lines under Windows if e.g. cp1252 is used as the source encoding. This patch reverts the behaviour of readline() to something that behaves more like Python 2.3: If a size parameter is given, read() is called only once. As a side effect of this, readline() now supports all types of linebreaks supported by unicode.splitlines(). Note that the tokenizer is still broken and it's possible to provoke segfaults (see http://www.python.org/sf/1089395).
* Trigger a few error cases in Modules/_codecsmodule.c.Walter Dörwald2004-10-281-0/+14
|
* SF #1048865: Fix a trivial typo that breaks StreamReader.readlines()Hye-Shik Chang2004-10-171-1/+12
|
* SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now supportWalter Dörwald2004-09-071-1/+117
| | | | | | | | | | | decoding incomplete input (when the input stream is temporarily exhausted). codecs.StreamReader now implements buffering, which enables proper readline support for the UTF-16 decoders. codecs.StreamReader.read() has a new argument chars which specifies the number of characters to return. codecs.StreamReader.readline() and codecs.StreamReader.readlines() have a new argument keepends. Trailing "\n"s will be stripped from the lines if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and PyUnicode_DecodeUTF16Stateful.
* Add generic codecs.encode() and .decode() APIs that don't imposeMarc-André Lemburg2004-07-101-1/+11
| | | | any restriction on the return type (like unicode.encode() et al. do).
* Whitespace normalization.Tim Peters2004-07-081-1/+1
|
* Add test case for unicode(somestring, "idna").Martin v. Löwis2004-03-241-1/+6
|
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-7/+7
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Whitespace normalization.Tim Peters2003-04-241-2/+2
|
* Skip nameprep test 3.43, as we do allow unassigned characters. The testMartin v. Löwis2003-04-181-2/+4
| | | | fails only in UCS-2 mode, since it tests a non-BMP character.
* Implement IDNA (Internationalized Domain Names in Applications).Martin v. Löwis2003-04-181-0/+296
|
* Fix for [ 543344 ] Interpreter crashes when recoding; suggestedMarc-André Lemburg2003-02-041-0/+9
| | | | | | by Michael Stone (mbrierst). Python 2.1.4, 2.2.2 candidate.
* Check whether a string resize is necessary at the endWalter Dörwald2002-09-031-1/+8
| | | | | | | | | of PyString_DecodeEscape(). This prevents a call to _PyString_Resize() for the empty string, which would result in a PyErr_BadInternalCall(), because the empty string has more than one reference. This closes SF bug http://www.python.org/sf/603937
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+2
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Change the PyUnit-based tests to use the test_main() approach. ThisFred Drake2001-09-201-1/+7
| | | | | allows using the tests with unittest.py as a script. The tests will still run when run as a script themselves.
* Test by Martin v. Loewis for the new UTF-16 codec handling of BOMMarc-André Lemburg2001-06-191-0/+25
marks.