New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netrc module not parsing passwords containing #s. #54673
Comments
The netrc module stops parsing passwords at # characters, which can be part of Tested with Python 2.7 and 3.1. |
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) |
Sorry, patch had a mistake |
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? |
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. |
bumping...can someone review this? The reported bug seems valid enough. |
Patch looks good to me. Supplied test fails before and works after fix applied. |
Committed to py3k in r86925, 3.1 in r86926, and 2.7 in r86927. Thanks for the patch, Xuanji. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: