Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b34ef94

Browse files
committed
SF bug 557704: netrc module can't handle all passwords
Let netrc handle entries with login fields (mail servers for instance) by having login default to ''. Backport candidate.
1 parent bfcbfa7 commit b34ef94

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/netrc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ def __init__(self, file=None):
5656
"bad toplevel token %r" % tt, file, lexer.lineno)
5757

5858
# We're looking at start of an entry for a named machine or default.
59-
login = account = password = None
59+
login = ''
60+
account = password = None
6061
self.hosts[entryname] = {}
6162
while 1:
6263
tt = lexer.get_token()
6364
if (tt=='' or tt == 'machine' or
6465
tt == 'default' or tt =='macdef'):
65-
if login and password:
66+
if password:
6667
self.hosts[entryname] = (login, account, password)
6768
lexer.push_token(tt)
6869
break

0 commit comments

Comments
 (0)