[issue10639] reindent.py converts newlines to platform default

2011-07-26 Thread Éric Araujo
Changes by Éric Araujo : Added file: http://bugs.python.org/file22765/900df5732f93.diff ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue10639] reindent.py converts newlines to platform default

2011-07-25 Thread Jason R. Coombs
Jason R. Coombs added the comment: I looked into the possibility of retaining newline characters even for files with mixed newlines, but I've decided that's too intrusive an approach. The current implementation specifically takes measures to strip whitespaces from the ends of lines, so it see

[issue10639] reindent.py converts newlines to platform default

2011-05-15 Thread Jason R. Coombs
Jason R. Coombs added the comment: Re msg125818, I agree that the mixed EOLs is also a potential problem, though the proposed solution behaves better than the status quo, where the EOLs get converted without warning. It would be desirable for the patch to be more robust in that situation (pr

[issue10639] reindent.py converts newlines to platform default

2011-01-29 Thread Éric Araujo
Éric Araujo added the comment: That is a valid use case, so +1 on not changing behavior and adding a new option in 3.3 (in another bug report). What is your reply to msg125818? -- ___ Python tracker

[issue10639] reindent.py converts newlines to platform default

2011-01-29 Thread Jason R. Coombs
Jason R. Coombs added the comment: That's great that reindent works in your environment, but that's no help in my environment. Here's the use case: We have a software package developed in Unix and with Unix LF line endings. The code base may also contain files with CRLF line endings (I can't

[issue10639] reindent.py converts newlines to platform default

2011-01-29 Thread Éric Araujo
Éric Araujo added the comment: I’m not opposed to reindent normalizing EOLs, given that our VCS hooks will translate them to the right thing (for example, making sure that files specific to the Windows build use CRLF, not LF, even if edited on POSIX). -- _

[issue10639] reindent.py converts newlines to platform default

2011-01-23 Thread Senthil Kumaran
Senthil Kumaran added the comment: Why is reindent.py translating the whole file to platform default newline such a bad thing? Could not it be considered as helpful behavior, especially in the case where the user has mixed EOLs by mistake? -- nosy: +orsenthil

[issue10639] reindent.py converts newlines to platform default

2011-01-08 Thread Éric Araujo
Éric Araujo added the comment: I did a bit of testing on demo files. The first one I tested with had mixed EOLs, in which case the newlines attribute will be a tuple and open(..., newline=r.newlines) will fail. For reference: http://docs.python.org/dev/library/io#io.TextIOBase.newlines Wha

[issue10639] reindent.py converts newlines to platform default

2010-12-19 Thread Éric Araujo
Éric Araujo added the comment: If nobody objects, I will commit this when py3k is unfrozen. -- assignee: -> eric.araujo status: open -> pending ___ Python tracker ___ _

[issue10639] reindent.py converts newlines to platform default

2010-12-06 Thread Éric Araujo
Éric Araujo added the comment: Looks good. -- nosy: +eric.araujo stage: -> patch review type: -> behavior versions: +Python 2.7 ___ Python tracker ___

[issue10639] reindent.py converts newlines to platform default

2010-12-06 Thread Jason R. Coombs
Jason R. Coombs added the comment: Merged the patch with the latest trunk. -- Added file: http://bugs.python.org/file19956/reindent-autonewline.patch ___ Python tracker ___

[issue10639] reindent.py converts newlines to platform default

2010-12-06 Thread Jason R. Coombs
Changes by Jason R. Coombs : Removed file: http://bugs.python.org/file19955/reindent-autonewline.patch ___ Python tracker ___ ___ Python-bugs-

[issue10639] reindent.py converts newlines to platform default

2010-12-06 Thread Jason R. Coombs
New submission from Jason R. Coombs : When reindent.py runs, it will convert the line endings for each file it converts to the default line ending for the platform on which reindent.py runs. It would be better if reindent.py would retain line endings of the source file. Attached is a patch tha