[Python-checkins] python/dist/src/Objects fileobject.c,2.178,2.179
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Sun, 18 May 2003 05:56:28 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv7403/Objects
Modified Files:
fileobject.c
Log Message:
Only encode Unicode objects when printing them raw.
Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.178
retrieving revision 2.179
diff -C2 -d -r2.178 -r2.179
*** fileobject.c 10 May 2003 07:08:50 -0000 2.178
--- fileobject.c 18 May 2003 12:56:25 -0000 2.179
***************
*** 2065,2069 ****
}
#ifdef Py_USING_UNICODE
! if (PyUnicode_Check(v) && enc != Py_None) {
char *cenc = PyString_AS_STRING(enc);
value = PyUnicode_AsEncodedString(v, cenc, "strict");
--- 2065,2070 ----
}
#ifdef Py_USING_UNICODE
! if ((flags & Py_PRINT_RAW) &&
! PyUnicode_Check(v) && enc != Py_None) {
char *cenc = PyString_AS_STRING(enc);
value = PyUnicode_AsEncodedString(v, cenc, "strict");