On Monday 15 August 2005 12:14, Lars Gullik Bjønnes wrote: > | > | Yes, I have tested the code and I have verified that it works as it > | should. :-) > > sure but it is comming awfully late.
For some reason the real fix always eluded me. It was in Paris when I finally found the real culprit. > So what _real_ problems do we see because of this. Actually > experienced stuff? As far as I know (sometimes bugs do not get reported) none. That said I consider this to be a really bad bug. We should never mess with the users preamble unless we need to. This type of problems is also quite difficult to debug unless you aware of it. I do not want to have a possible document corruption. In this case since the fix is easy, both conceptually as well as codewise, I propose to do it now. > >> | + # remove end of line char(s) > >> | + if line[-2:-1] == '\r': > >> | + line = line[:-2] > >> | + else: > >> | line = line[:-1] > >> > >> rstrip('\r\n', line) > | > | Oh yes, but that does not handle the case where the line simply ends > | with \n or \r... > > because? My mistake, I looked for it at the time I had to solve the problem the first time and then I forgot the reason why I had ignored rstrip. You were right, as you can see here http://docs.python.org/lib/node110.html that version of rstrip was only introduced in 2.2.3, not before. So for 1.5.2 compatibility we should stay with the current scheme. The previous versions only removes whitespace. Not important but the right syntax is the opposite of what you use: rstrip( s[, chars]) -- José Abílio Matos