msg105012 - (view) |
Author: Mattelaer (omatt) |
Date: 2010-05-05 11:35 |
When using the Cmd module on a file. it happens that the last line is truncated from the last caracther. The problem is simply that it can happen that the last line doesn't finish by '\n' charcacter. In consequence the line which is suppose to suppress the '\n' suppress another character. Cheers, Olivier |
|
|
msg105235 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-05-07 21:48 |
Setting version to 3.2, since this change would not be backward compatible and 2.7 is already in beta. |
|
|
msg112184 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-07-31 19:26 |
Here is a unit test that demonstrates the problem (against py3k trunk). I'm not convinced that fixing this would be backward incompatible. |
|
|
msg112239 - (view) |
Author: Catherine Devlin (catherine) |
Date: 2010-08-01 00:40 |
Patch created live during PyOhio 2010 "Teach Me Python Bugfixing" session! |
|
|
msg112241 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-08-01 00:50 |
Test runs okay on posix (linux2). Does the fix need to work with '\r\n' too? Aside: Your patch has trailing spaces, you can spot them with good editor settings. |
|
|
msg112242 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-08-01 00:51 |
Sorry, RDM is the actual culprit ;) |
|
|
msg112255 - (view) |
Author: Catherine Devlin (catherine) |
Date: 2010-08-01 01:59 |
same patch, stripped of trailing spaces |
|
|
msg112263 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-08-01 04:16 |
Éric: thanks for spotting the whitespace before I got smacked by the commit hook. As for \r\n, our thought was that would be a feature (universal newline support), but upon reflection the current fix could actually break working code if by some weird chance someone is feeding \r terminated files to Cmd, while using \r\n should not break anything, since a \r\n terminated file would currently not work (since the \r would be left on the lines). So I've changed the fix to strip '\r\n' in the commit (py3k r83380, 2.7 r83381, 2.5 r83382, 3.1 r83383). |
|
|
msg112313 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-08-01 11:35 |
Universal newline mode helps when reading from stdin, but what I had in mind was actually in cmd.exe putting CRLF. Re-reading the original report, I see this is not a concern, since the bug is about cmd used with a file only, not interactively, so my remark was moot. |
|
|
msg112314 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-08-01 11:37 |
If “l” sorts after “a”, you’ve misplaced Catherine in ACKS. Funny how often this happens :) (Cheers for the Teach Me session by the way Catherine!) |
|
|
msg112408 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-08-01 23:58 |
Thanks, Éric. Fixed. |
|
|
msg112425 - (view) |
Author: Mattelaer (omatt) |
Date: 2010-08-02 07:20 |
Thanks a lot for the fix. On 02-août-10, at 01:58, R. David Murray wrote: > > R. David Murray <rdmurray@bitdance.com> added the comment: > > Thanks, Éric. Fixed. > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue8620> > _______________________________________ |
|
|