[Python-checkins] CVS: python/dist/src/Lib multifile.py,1.19,1.20
Guido van Rossum
gvanrossum@users.sourceforge.net
Fri, 05 Oct 2001 14:22:23 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.49,2.50 dictobject.c,2.113,2.114 fileobject.c,2.131,2.132 floatobject.c,2.100,2.101 funcobject.c,2.45,2.46 listobject.c,2.101,2.102 longobject.c,1.110,1.111 moduleobject.c,2.38,2.39 stringobject.c,2.136,2.137 tupleobject.c,2.60,2.61 typeobject.c,2.89,2.90 unicodeobject.c,2.117,2.118
- Next message: [Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.49,2.50
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv15457
Modified Files:
multifile.py
Log Message:
Martijn Pieters convinced me that when readline() strips the trailing
newline from a multifile part, it should also strip a trailing \r\n.
Index: multifile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/multifile.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** multifile.py 2001/09/18 14:34:06 1.19
--- multifile.py 2001/10/05 21:22:21 1.20
***************
*** 77,82 ****
if line:
self.readahead = self._readline()
! if not self.readahead and line[-1:] == "\n":
! line = line[:-1]
return line
--- 77,85 ----
if line:
self.readahead = self._readline()
! if not self.readahead:
! if line[-2:] == "\r\n":
! line = line[:-2]
! elif line[-1:] == "\n":
! line = line[:-1]
return line
- Previous message: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.49,2.50 dictobject.c,2.113,2.114 fileobject.c,2.131,2.132 floatobject.c,2.100,2.101 funcobject.c,2.45,2.46 listobject.c,2.101,2.102 longobject.c,1.110,1.111 moduleobject.c,2.38,2.39 stringobject.c,2.136,2.137 tupleobject.c,2.60,2.61 typeobject.c,2.89,2.90 unicodeobject.c,2.117,2.118
- Next message: [Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.49,2.50
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]