[Python-checkins] python/nondist/peps pep-0293.txt,1.6,1.7

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Fri, 31 Jan 2003 09:19:42 -0800


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv3391/nondist/peps

Modified Files:
	pep-0293.txt 
Log Message:
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.


Index: pep-0293.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0293.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pep-0293.txt	3 Sep 2002 15:58:43 -0000	1.6
--- pep-0293.txt	31 Jan 2003 17:19:09 -0000	1.7
***************
*** 105,108 ****
--- 105,112 ----
      replacement) the encoder will continue encoding.
  
+     Negative values for newpos are treated as being relative to
+     end of object. If newpos is out of bounds the encoder will raise
+     an IndexError.
+ 
      If the replacement string itself contains an unencodable character
      the encoder raises the exception object (but may set a different