[Python-checkins] python/dist/src/Objects stringobject.c,2.185,2.186 unicodeobject.c,2.166,2.167

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Mon, 02 Sep 2002 06:14:34 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv19683/Objects

Modified Files:
	stringobject.c unicodeobject.c 
Log Message:
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)


Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.185
retrieving revision 2.186
diff -C2 -d -r2.185 -r2.186
*** stringobject.c	24 Aug 2002 06:57:49 -0000	2.185
--- stringobject.c	2 Sep 2002 13:14:31 -0000	2.186
***************
*** 2469,2473 ****
  to the default encoding. errors may be given to set a different error\n\
  handling scheme. Default is 'strict' meaning that encoding errors raise\n\
! a ValueError. Other possible values are 'ignore' and 'replace'.");
  
  static PyObject *
--- 2469,2475 ----
  to the default encoding. errors may be given to set a different error\n\
  handling scheme. Default is 'strict' meaning that encoding errors raise\n\
! a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n\
! 'xmlcharrefreplace' as well as any other name registered with\n\
! codecs.register_error that is able to handle UnicodeEncodeErrors.");
  
  static PyObject *
***************
*** 2488,2492 ****
  to the default encoding. errors may be given to set a different error\n\
  handling scheme. Default is 'strict' meaning that encoding errors raise\n\
! a ValueError. Other possible values are 'ignore' and 'replace'.");
  
  static PyObject *
--- 2490,2496 ----
  to the default encoding. errors may be given to set a different error\n\
  handling scheme. Default is 'strict' meaning that encoding errors raise\n\
! a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\
! as well as any other name registerd with codecs.register_error that is\n\
! able to handle UnicodeDecodeErrors.");
  
  static PyObject *

Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.166
retrieving revision 2.167
diff -C2 -d -r2.166 -r2.167
*** unicodeobject.c	23 Aug 2002 18:50:20 -0000	2.166
--- unicodeobject.c	2 Sep 2002 13:14:31 -0000	2.167
***************
*** 529,534 ****
  {
      PyObject *buffer = NULL, *unicode;
!     
!     if (encoding == NULL) 
  	encoding = PyUnicode_GetDefaultEncoding();
  
--- 529,534 ----
  {
      PyObject *buffer = NULL, *unicode;
! 
[...2654 lines suppressed...]
   onError:
+     Py_XDECREF(exc);
+     Py_XDECREF(errorHandler);
      return -1;
  }
***************
*** 3928,3932 ****
  default string encoding. errors may be given to set a different error\n\
  handling scheme. Default is 'strict' meaning that encoding errors raise\n\
! a ValueError. Other possible values are 'ignore' and 'replace'.");
  
  static PyObject *
--- 4614,4620 ----
  default string encoding. errors may be given to set a different error\n\
  handling scheme. Default is 'strict' meaning that encoding errors raise\n\
! a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n\
! 'xmlcharrefreplace' as well as any other name registered with\n\
! codecs.register_error that can handle UnicodeEncodeErrors.");
  
  static PyObject *