summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 88697 via svnmerge fromVictor Stinner2011-03-011-0/+13
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88697 | victor.stinner | 2011-03-01 23:46:52 +0100 (mar., 01 mars 2011) | 4 lines Issue #11246: Fix PyUnicode_FromFormat("%V") Decode the byte string from UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode). Patch written by Ray Allen. ........
* Merged revisions 88481 via svnmerge fromVictor Stinner2011-02-231-1/+4
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88481 | victor.stinner | 2011-02-21 22:13:44 +0100 (lun., 21 févr. 2011) | 4 lines Fix PyUnicode_FromFormatV("%c") for non-BMP char Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on narrow build. ........
* Issue #11302: missing type check on _string.formatter_field_name_split and ↵Eric Smith2011-01-291-0/+52
| | | | | | _string.formatter_parser caused crash. Originial patch by haypo, reviewed by me, okayed by Georg.
* test_unicode: use ctypes to test PyUnicode_FromFormat()Victor Stinner2011-01-051-6/+20
| | | | | Instead of _testcapi.format_unicode() because it has a limited API: it requires exactly one argument of type unicode.
* Issue #10557: Fixed error messages from float() and other numericAlexander Belopolsky2010-12-041-2/+7
| | | | | | types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
* #10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and ↵Ezio Melotti2010-12-011-1/+1
| | | | assertRaisesRegex.
* Fix tests when ctypes isn't availableAntoine Pitrou2010-11-221-0/+2
|
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-18/+18
|
* Removed unused test classes from test_format_map().Eric Smith2010-11-061-38/+0
|
* Issue #6081: Add str.format_map. str.format_map(mapping) is similar to ↵Eric Smith2010-11-041-0/+78
| | | | str.format(**mapping), except mapping does not get converted to a dict.
* Recode modules from latin-1 to utf-8Antoine Pitrou2010-10-271-3/+2
|
* PyUnicode_FromFormatV(): Fix %A formatVictor Stinner2010-10-181-3/+6
| | | | It was not completly implemented. Add a test.
* Upgrade to Unicode 6.0.0.Martin v. Löwis2010-10-111-1/+1
| | | | | | | | makeunicodedata.py: download all data files from unicode.org, switch to extracting Unihan data from zip file. Read linebreakprops and derivednormalizationprops even for old versions, even though they are not used in delta records. test:unicode.py: U+11000 is now assigned, use U+14000 instead.
* Issue #8670: Rename testcapi unicode test methodsVictor Stinner2010-10-021-11/+11
| | | | | * test_aswidechar() => unicode_aswidechar() * test_aswidecharstring() => unicode_aswidecharstring()
* Oops, revert unwanted _testcapi changes of r85174Victor Stinner2010-10-021-11/+11
|
* Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_tVictor Stinner2010-10-021-11/+11
|
* Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replaceVictor Stinner2010-10-021-0/+20
| | | | | UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and 32 bits wchar_t (eg. Linux in narrow build).
* Issue #8870: PyUnicode_AsWideCharString() doesn't count the trailing nul ↵Victor Stinner2010-10-021-0/+39
| | | | | | character And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
* Issue 7994: Make object.__format__() raise a PendingDeprecationWarningEric Smith2010-09-131-4/+7
| | | | | | | | | if the format string is not empty. Manually merge r79596 and r84772 from 2.x. Also, apparently test_format() from test_builtin never made it into 3.x. I've added it as well. It tests the basic format() infrastructure.
* Reenable test_ucs4 and remove some duplicated lines.Florent Xicluna2010-09-131-26/+17
|
* Issue #9738, #9836: Fix refleak introduced by r84704Victor Stinner2010-09-121-1/+1
|
* Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error onVictor Stinner2010-09-111-0/+14
| | | | | | a non-ASCII byte in the format string. Document also the encoding.
* #5127: Even on narrow unicode builds, the C functions that access the UnicodeAmaury Forgeot d'Arc2010-08-181-0/+4
| | | | | | | | | | Database (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others) now accept and return characters from the full Unicode range (Py_UCS4). The differences from Python code are few: - unicodedata.numeric(), unicodedata.decimal() and unicodedata.digit() now return the correct value for large code points - repr() may consider more characters as printable.
* Remove unused test class.Eric Smith2010-08-121-5/+0
|
* Sub-issue of #9036: Fix incorrect use of Py_CHARMASK.Stefan Krah2010-07-191-0/+1
|
* Update PyUnicode_DecodeUTF8 from RFC 2279 to RFC 3629.Ezio Melotti2010-07-011-0/+153
| | | | | | | | | | | | | 1) #8271: when a byte sequence is invalid, only the start byte and all the valid continuation bytes are now replaced by U+FFFD, instead of replacing the number of bytes specified by the start byte. See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (pages 94-95); 2) 5- and 6-bytes-long UTF-8 sequences are now considered invalid (no changes in behavior); 3) Change the error messages "unexpected code byte" to "invalid start byte" and "invalid data" to "invalid continuation byte"; 4) Add an extensive set of tests in test_unicode; 5) Fix test_codeccallbacks because it was failing after this change.
* Merged revisions 81499,81506 via svnmerge fromBenjamin Peterson2010-06-271-4/+4
| | | | | | | | | | | | | | 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 ........
* Merged revisions 81820 via svnmerge fromBenjamin Peterson2010-06-071-0/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line correctly overflow when indexes are too large ........
* Merged revisions 79278,79280 via svnmerge fromVictor Stinner2010-03-221-0/+8
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79278 | victor.stinner | 2010-03-22 13:24:37 +0100 (lun., 22 mars 2010) | 2 lines Issue #1583863: An unicode subclass can now override the __str__ method ........ r79280 | victor.stinner | 2010-03-22 13:36:28 +0100 (lun., 22 mars 2010) | 5 lines Fix the NEWS about my last commit: an unicode subclass can now override the __unicode__ method (and not the __str__ method). Simplify also the testcase. ........
* Clean up the warnings filter use in test_unicode.Brett Cannon2010-03-201-16/+10
|
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-26/+26
| | | | A patch from Dave Malcolm.
* Merged revisions 74929 via svnmerge fromBenjamin Peterson2009-09-181-0/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r74929 | benjamin.peterson | 2009-09-18 16:14:55 -0500 (Fri, 18 Sep 2009) | 1 line add keyword arguments support to str/unicode encode and decode #6300 ........
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-38/+38
|
* Issue #6150: Fix test_unicode on wide-unicode builds.Martin v. Löwis2009-06-011-6/+7
|
* Merged revisions 72848 via svnmerge fromEric Smith2009-05-231-0/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72848 | eric.smith | 2009-05-23 09:56:13 -0400 (Sat, 23 May 2009) | 1 line Issue 6089: str.format raises SystemError. ........
* Rename the surrogates error handler to surrogatepass.Martin v. Löwis2009-05-101-3/+3
|
* Issue #3382. float 'F' formatting no longer maps to 'f'. This only affects ↵Eric Smith2009-05-061-0/+8
| | | | nan and inf.
* Merged revisions 72283-72284 via svnmerge fromAntoine Pitrou2009-05-041-4/+16
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72283 | antoine.pitrou | 2009-05-04 20:32:32 +0200 (lun., 04 mai 2009) | 4 lines Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. ........ r72284 | antoine.pitrou | 2009-05-04 20:32:50 +0200 (lun., 04 mai 2009) | 3 lines Add Nick Barnes to ACKS. ........
* Issue #3672: Reject surrogates in utf-8 codec; add surrogates errorMartin v. Löwis2009-05-021-3/+3
| | | | handler.
* fix isprintable() on space characters #5126Benjamin Peterson2009-03-261-0/+1
|
* Merged revisions 70364 via svnmerge fromEric Smith2009-03-141-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70364 | eric.smith | 2009-03-14 07:57:26 -0400 (Sat, 14 Mar 2009) | 17 lines Issue 5237, Allow auto-numbered replacement fields in str.format() strings. For simple uses for str.format(), this makes the typing easier. Hopfully this will help in the adoption of str.format(). For example: 'The {} is {}'.format('sky', 'blue') You can mix and matcth auto-numbering and named replacement fields: 'The {} is {color}'.format('sky', color='blue') But you can't mix and match auto-numbering and specified numbering: 'The {0} is {}'.format('sky', 'blue') ValueError: cannot switch from manual field specification to automatic field numbering Will port to 3.1. ........
* The Unicode database was updated to 5.1, and some characters have become ↵Amaury Forgeot d'Arc2008-09-101-3/+3
| | | | | | printable. Change the tests and use another code point.
* Merged revisions 66235 via svnmerge fromAntoine Pitrou2008-09-051-1/+4
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66235 | antoine.pitrou | 2008-09-06 00:04:54 +0200 (sam., 06 sept. 2008) | 6 lines #3601: test_unicode.test_raiseMemError fails in UCS4 Reviewed by Benjamin Peterson on IRC. ........
* Merged revisions 65773 via svnmerge fromAntoine Pitrou2008-08-171-9/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65773 | antoine.pitrou | 2008-08-17 19:01:49 +0200 (dim., 17 août 2008) | 3 lines #3556: test_raiseMemError consumes an insane amount of memory ........
* Merged revisions 65339-65340,65342 via svnmerge fromAmaury Forgeot d'Arc2008-08-011-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65339 | amaury.forgeotdarc | 2008-07-31 23:28:03 +0200 (jeu., 31 juil. 2008) | 5 lines #3479: unichr(2**32) used to return u'\x00'. The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. (why doesn't gcc issue a truncation warning in this case?) ........ r65340 | amaury.forgeotdarc | 2008-07-31 23:35:03 +0200 (jeu., 31 juil. 2008) | 2 lines Remove a dummy test that was checked in by mistake ........ r65342 | amaury.forgeotdarc | 2008-08-01 01:39:05 +0200 (ven., 01 août 2008) | 8 lines Correct a crash when two successive unicode allocations fail with a MemoryError: the freelist contained half-initialized objects with freed pointers. The comment /* XXX UNREF/NEWREF interface should be more symmetrical */ was copied from tupleobject.c, and appears in some other places. I sign the petition. ........
* Merged revisions 65227 via svnmerge fromAntoine Pitrou2008-07-251-0/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65227 | antoine.pitrou | 2008-07-25 19:45:59 +0200 (ven., 25 juil. 2008) | 3 lines #2242: utf7 decoding crashes on bogus input on some Windows/MSVC versions ........
* Forward port of r64958.Eric Smith2008-07-151-0/+4
| | | | Added '#' formatting to integers. This adds the 0b, 0o, or 0x prefix for bin, oct, hex. There's still one failing case, and I need to finish the docs. I hope to finish those today.
* Issue #3280: like chr() already does, the "%c" format now accepts the full ↵Amaury Forgeot d'Arc2008-07-041-1/+4
| | | | | | unicode range even on "narrow Unicode" builds; the result is a pair of UTF-16 surrogates.
* Issue #3282: str.isprintable() should return False for undefined Unicode ↵Georg Brandl2008-07-041-4/+13
| | | | characters.
* #2630: Implement PEP 3138.Georg Brandl2008-06-111-9/+70
| | | | | | | The repr() of a string now contains printable Unicode characters unescaped. The new ascii() builtin can be used to get a repr() with only ASCII characters in it. PEP and patch were written by Atsuo Ishimoto.