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.__repr__() is broken for writing to file #74989
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=<Date2017-11-03.05:37:32.768>created_at=<Date2017-06-29.19:12:21.752>labels= ['3.7', 'type-bug', 'library']
title='netrc.__repr__() is broken for writing to file'updated_at=<Date2017-12-10.06:10:05.430>user='https://github.com/Bezier89'
The documentation for netrc.__repr__() states that it "dumps the class data as a string in the format of a netrc file". However, when you try to actually do this, you'll encounter a nasty bug. This can be seen by running the follow commands:
If you write this back out to the .netrc file, authentication will fail since incorrect username/password (with ' character at beginning at end) will be passed.
Activity
Bezier89 commentedon Jun 29, 2017
Have any valid .netrc file. For testing purposes you can use this:
machine abc.xyz login myusername password mypassword
The documentation for netrc.__repr__() states that it "dumps the class data as a string in the format of a netrc file". However, when you try to actually do this, you'll encounter a nasty bug. This can be seen by running the follow commands:
The expected output is:
machine abc.xyz
login myusername
password mypassword
The actual output is:
machine abc.xyz
login 'myusername'
password 'mypassword'
If you write this back out to the .netrc file, authentication will fail since incorrect username/password (with ' character at beginning at end) will be passed.
methane commentedon Sep 30, 2017
New changeset b24cd05 by INADA Naoki (James Sexton) in branch 'master':
bpo-30806 netrc.__repr__() is broken for writing to file (GH-2491)
b24cd05
methane commentedon Nov 3, 2017
New changeset 5fbe5e1 by INADA Naoki (Miss Islington (bot)) in branch '3.6':
bpo-30806: Fix netrc.__repr__() format (GH-2491)
5fbe5e1
methane commentedon Dec 10, 2017
New changeset 3b9173d by INADA Naoki (Steven Loria) in branch '2.7':
bpo-30806: Fix netrc.__repr__() format (GH-2491)
3b9173d