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 throws NetrcParseError for record without 'password' #72966
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:
assignee=Noneclosed_at=Nonecreated_at=<Date2016-11-23.16:18:23.195>labels= ['type-bug', 'library']
title="netrc throws NetrcParseError for record without 'password'"updated_at=<Date2016-11-26.11:15:20.420>user='https://bugs.python.org/MarkWood'
netrc.netrc() throws a NetrcParseError if ~/.netrc contains an entry witout a 'password' field. Other users of .netrc do not do this. In my case, I have entries for sftp hosts which will use public-key authentication instead of a password.
What I would suggest is that if any or all of 'login', 'account', and 'password' are omitted, simply accept that and store a 0-length string.
Activity
MarkWood commentedon Nov 23, 2016
netrc.netrc() throws a NetrcParseError if ~/.netrc contains an entry witout a 'password' field. Other users of .netrc do not do this. In my case, I have entries for sftp hosts which will use public-key authentication instead of a password.
What I would suggest is that if any or all of 'login', 'account', and 'password' are omitted, simply accept that and store a 0-length string.
Someone on StackOverflow says he has rewritten netrc to fix various problems but doesn't know how to contribute it. http://stackoverflow.com/questions/28754547/python-netrc-error-on-file-with-comment
methane commentedon Sep 30, 2026
fixed by #26330