[issue12009] netrc module crashes if netrc file has comment lines

2011-06-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: lexer.instream.readline(): no, we can't just call that without the seek, because reading the token that started with # may have caused the line to be consumed already. I've expanded the comment to explain this. cygwin: I'd add a

[issue12009] netrc module crashes if netrc file has comment lines

2011-06-10 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset cb3a77b0f8dd by Benjamin Peterson in branch '2.7': fix regression in netrc comment handling (closes #12009) http://hg.python.org/cpython/rev/cb3a77b0f8dd New changeset 6993910be426 by Benjamin Peterson in branch '2.7': merge 2.7.2

[issue12009] netrc module crashes if netrc file has comment lines

2011-06-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Here is an updated patch with the tests refactored even further. The patch seems correct to me, and almost all the comment tests fail before the patch and pass after. Benjamin, this patch fixes a regression relative to 2.7.1 and 3.1.3,

[issue12009] netrc module crashes if netrc file has comment lines

2011-06-09 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I'd like to see this go in. +# seek to the beginning of the comment, then skip the line. +pos = len(tt) + 1 +lexer.instream.seek(-pos, 1) +lexer.instream.readline() Can't

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Ruslan Mstoi rms...@gmail.com added the comment: Uploading patch updated according to the review comments. -- Added file: http://bugs.python.org/file22074/issue12009_patch3.diff ___ Python tracker rep...@bugs.python.org

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Added file: http://bugs.python.org/file22075/issue12009_patch4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Removed file: http://bugs.python.org/file22013/issue12009_patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Removed file: http://bugs.python.org/file22019/issue12009_patch2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Removed file: http://bugs.python.org/file22074/issue12009_patch3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: +1 to that last patch, modulo removal of an unnecessary docstring on one test method (IIRC the test runner would display it in verbose mode and that would not be useful output; the test speaks for itself, only a comment with this bug number is

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Added file: http://bugs.python.org/file22076/issue12009_patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Removed file: http://bugs.python.org/file22075/issue12009_patch4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi
Ruslan Mstoi rms...@gmail.com added the comment: Thanks for helping with cleaning up the patch. I already removed that docstring too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-18 Thread Ruslan Mstoi
Ruslan Mstoi rms...@gmail.com added the comment: I agree, the test input was becoming unmaintainable. So, I updated the patch with the refactored unit tests. -- Added file: http://bugs.python.org/file22018/issue12009_patch.diff ___ Python tracker

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-18 Thread Ruslan Mstoi
Changes by Ruslan Mstoi rms...@gmail.com: Removed file: http://bugs.python.org/file22018/issue12009_patch.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-18 Thread Ruslan Mstoi
Ruslan Mstoi rms...@gmail.com added the comment: removed leftover debug code from patch -- Added file: http://bugs.python.org/file22019/issue12009_patch2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-17 Thread Ruslan Mstoi
Ruslan Mstoi rms...@gmail.com added the comment: OK, finally got some time to make a patch. The fix is to seek the beginning of the comment before calling readline. That way the next line won't be deleted. Also, provided a test case for this issue in the patch. -- keywords: +patch

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-17 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- assignee: - r.david.murray stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009 ___

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-17 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: With these new additions, the test input is getting unwieldy. If you have the time, I'd like to see the unit tests refactored to be more unit-testy. That is, instead of a single test netrc file, have multiple inputs, one for each

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the report. Would you like to submit a patch? If so, guidelines are on http://docs.python.org/devguide -- nosy: +eric.araujo versions: +Python 3.1, Python 3.2, Python 3.3 ___ Python

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-05 Thread Ruslan Mstoi
New submission from Ruslan Mstoi rms...@gmail.com: It seems recent patch from Issue 10464 has introduced problems into one line comment handling of netrc module. Problem 1: If there is a line starting with a comment sign the following traceback is shown: Traceback (most recent call last):

[issue12009] netrc module crashes if netrc file has comment lines

2011-05-05 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- keywords: +easy nosy: +r.david.murray stage: - test needed type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12009