You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
netrc module not parsing passwords containing #s. #54673
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commented on Nov 20, 2010
IIIIllllIIIIllllIIIIllllIIIIllllIIIIllmannequin
Mannequin
More actions
Included test case for the reported bug. Test fails on my machine. Also split up test_case_1 (in order to put in the new test case cleanly)
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commented on Nov 20, 2010
IIIIllllIIIIllllIIIIllllIIIIllllIIIIllmannequin
Mannequin
More actions
Sorry, patch had a mistake
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commented on Nov 20, 2010
IIIIllllIIIIllllIIIIllllIIIIllllIIIIllmannequin
Mannequin
More actions
The issue seems to be that when shlex (the lexer that netrc uses) sees a '#' character it thinks that the rest of the line is a comment. I am not sure what the behavior of netrc should be - should it treat '#' as beginning a comment only if its the first non-whitespace character on a line? Should shlex be changed to reflect this?
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commented on Nov 25, 2010
IIIIllllIIIIllllIIIIllllIIIIllllIIIIllmannequin
Mannequin
More actions
The patch attached (issue_10464_fix) moves handling of the '#' character from shlex to netrc, and makes netrc consider as comments lines whose first not-whitespace character is '#' instead of all text following '#' (which is what shlex does and which causes this bug). It also includes a test case.
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commented on Nov 30, 2010
IIIIllllIIIIllllIIIIllllIIIIllllIIIIllmannequin
Mannequin
More actions
bumping...can someone review this? The reported bug seems valid enough.
Activity
theisz commentedon Nov 20, 2010
The netrc module stops parsing passwords at # characters, which can be part of
passwords.
Tested with Python 2.7 and 3.1.
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commentedon Nov 20, 2010
Included test case for the reported bug. Test fails on my machine. Also split up test_case_1 (in order to put in the new test case cleanly)
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commentedon Nov 20, 2010
Sorry, patch had a mistake
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commentedon Nov 20, 2010
The issue seems to be that when shlex (the lexer that netrc uses) sees a '#' character it thinks that the rest of the line is a comment. I am not sure what the behavior of netrc should be - should it treat '#' as beginning a comment only if its the first non-whitespace character on a line? Should shlex be changed to reflect this?
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commentedon Nov 25, 2010
The patch attached (issue_10464_fix) moves handling of the '#' character from shlex to netrc, and makes netrc consider as comments lines whose first not-whitespace character is '#' instead of all text following '#' (which is what shlex does and which causes this bug). It also includes a test case.
IIIIllllIIIIllllIIIIllllIIIIllllIIIIll commentedon Nov 30, 2010
bumping...can someone review this? The reported bug seems valid enough.
ned-deily commentedon Nov 30, 2010
Patch looks good to me. Supplied test fails before and works after fix applied.
bitdancer commentedon Dec 2, 2010
Committed to py3k in r86925, 3.1 in r86926, and 2.7 in r86927.
Thanks for the patch, Xuanji.