Commit Graph

10 Commits

Author SHA1 Message Date
Tim Peters f2715e0764 Whitespace normalization. 2003-02-19 02:35:07 +00:00
Walter Dörwald 2e0b18af30 Change the treatment of positions returned by PEP293
error handers in the Unicode codecs: Negative
positions are treated as being relative to the end of
the input and out of bounds positions result in an
IndexError.

Also update the PEP and include an explanation of
this in the documentation for codecs.register_error.

Fixes a small bug in iconv_codecs: if the position
from the callback is negative *add* it to the size
instead of substracting it.

From SF patch #677429.
2003-01-31 17:19:08 +00:00
Walter Dörwald ea4250df7d Add comments and remove duplicate tests. 2003-01-20 02:34:07 +00:00
Walter Dörwald 0cb27dd023 Make the test scripts work again with narrow Python builds. 2003-01-09 11:38:50 +00:00
Walter Dörwald 30537a46ac Add a few test cases to increase code coverage:
From:
 69.73% of 294 source lines executed in file ./Modules/_codecsmodule.c
 79.47% of 487 source lines executed in file Python/codecs.c
 78.45% of 3643 source lines executed in file Objects/unicodeobject.c

To:
 70.41% of 294 source lines executed in file ./Modules/_codecsmodule.c
 82.75% of 487 source lines executed in file Python/codecs.c
 80.76% of 3638 source lines executed in file Objects/unicodeobject.c

This actually unearthed a bug in the handling of None
values in PyUnicode_EncodeCharmap.
2003-01-08 23:22:13 +00:00
Walter Dörwald 00445d2393 Fix typo in comment. 2002-11-25 17:58:02 +00:00
Martin v. Löwis 74a530d42d Update character names. 2002-11-23 19:41:01 +00:00
Tim Peters 3de75266aa Whitespace normalization. 2002-11-09 05:26:15 +00:00
Walter Dörwald 9ab7dd4d5b Add a test case that checks that the proper exception is raises
when the replacement from an encoding error callback is itself
unencodable.
2002-09-06 17:21:40 +00:00
Walter Dörwald 3aeb632c31 PEP 293 implemention (from SF patch http://www.python.org/sf/432401) 2002-09-02 13:14:32 +00:00