[Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.126,2.127

Martin v. L?wis loewis@users.sourceforge.net
Wed, 19 Sep 2001 06:47:34 -0700


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

Modified Files:
	fileobject.c 
Log Message:
Patch #462849: Pass Unicode objects to file's .write method.


Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.126
retrieving revision 2.127
diff -C2 -d -r2.126 -r2.127
*** fileobject.c	2001/09/14 03:26:08	2.126
--- fileobject.c	2001/09/19 13:47:32	2.127
***************
*** 1504,1510 ****
  	if (writer == NULL)
  		return -1;
! 	if (flags & Py_PRINT_RAW)
! 		value = PyObject_Str(v);
! 	else
  		value = PyObject_Repr(v);
  	if (value == NULL) {
--- 1504,1515 ----
  	if (writer == NULL)
  		return -1;
! 	if (flags & Py_PRINT_RAW) {
!                 if (PyUnicode_Check(v)) {
!                         value = v;
!                         Py_INCREF(value);
!                 } else
!                         value = PyObject_Str(v);
! 	}
!         else
  		value = PyObject_Repr(v);
  	if (value == NULL) {