Message228870
I know this is ancient, but the below patch handles spaces in passwords in 2.7.8 and 3.4 for me. If this is worth making into a new bug / proper patch I'm happy to do it.
$ diff -uw /c/Python278/Lib/netrc.py{-orig,}
--- /c/Python278/Lib/netrc.py-orig 2014-10-09 13:52:36.995286000 +0100
+++ /c/Python278/Lib/netrc.py 2014-10-09 13:53:05.041286000 +0100
@@ -111,7 +111,23 @@
"~/.netrc access too permissive: access"
" permissions must restrict access to only"
" the owner", file, lexer.lineno)
+ # handle passwords with quoted spaces
+ quote_chars = lexer.quotes
+ removed_chars = []
+ for quote_char in quote_chars:
+ if quote_char in lexer.wordchars:
+ lexer.wordchars = lexer.wordchars.replace(quote_char, '')
+ removed_chars.append(quote_char)
+ try:
+
password = lexer.get_token()
+
+ for quote_char in quote_chars:
+ if password.startswith(quote_char) and password.endswith(quote_char):
+ password = password[1:-1]
+ finally:
+ for removed_char in removed_chars:
+ lexer.wordchars += removed_char
else:
raise NetrcParseError("bad follower token %r" % tt,
file, lexer.lineno) |
|
Date |
User |
Action |
Args |
2014-10-09 12:57:41 | mdengler | set | recipients:
+ mdengler, gvanrossum, skip.montanaro, rhettinger, vimboss |
2014-10-09 12:57:41 | mdengler | set | messageid: <1412859461.83.0.910697366769.issue557704@psf.upfronthosting.co.za> |
2014-10-09 12:57:41 | mdengler | link | issue557704 messages |
2014-10-09 12:57:41 | mdengler | create | |
|