Jose' Matos <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: > >> What are the benefits of doing this now. Why cannot this wait? > | It fixes a class of dormant bugs. Everytime we examine the header files we | are looking in to the preamble and we risk to change it accidentally. This | is serious and a blocker to me.
| I had to fix several bugs before related with this code, now instead of | fixing some more I fixed the root of the problems. | Yes, I have tested the code and I have verified that it works as it | should. :-) sure but it is comming awfully late. So what _real_ problems do we see because of this. Actually experienced stuff? >> | + # 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? '\r\n' does not look for that "\r\n", it removes all \r and \n from end of a string. a = "\r\n\r\n\n\n\n\r\r" strip('\r\n' a) == "" | And no, if we open the file with mode "rb" it is not enough to guarantee | that we take care of every end of line cases. > | It happened before that lyx files created in other platforms still have | the wrong line termination so we simply want to play safe here. that is what rstrip does. -- Lgb