FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-30806 netrc.__repr__() is broken for writing to file by Bezier89 · Pull Request #2491 · python/cpython · GitHub

Repository navigation

bpo-30806 netrc.__repr__() is broken for writing to file - #2491

Merged
methane merged 4 commits into
python:masterfrom
Bezier89:master
Sep 30, 2017
Merged

methane merged 4 commits into
python:masterfrom
Bezier89:master

Conversation

Bezier89 commented Jun 29, 2017 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

Bezier89 changed the title Fix bug in netrc.__repr__() Issue 30806 netrc.__repr__() is broken for writing to file Jun 29, 2017
Bezier89 changed the title Issue 30806 netrc.__repr__() is broken for writing to file bpo-NNNN netrc.__repr__() is broken for writing to file Jun 29, 2017
Bezier89 changed the title bpo-NNNN netrc.__repr__() is broken for writing to file bpo-30806 netrc.__repr__() is broken for writing to file Jun 29, 2017
Comment thread Lib/netrc.py Outdated
for host in self.hosts.keys():
attrs = self.hosts[host]
rep = rep + "machine "+ host + "\n\tlogin " + repr(attrs[0]) + "\n"
rep = rep + "machine "+ host + "\n\tlogin " + str(attrs[0]) + "\n"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
rep += f"machine {host}\n\tlogin {attrs[0]}\n"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

Comment thread Lib/netrc.py Outdated
rep = rep + "account " + repr(attrs[1])
rep = rep + "\tpassword " + repr(attrs[2]) + "\n"
rep = rep + "\taccount " + str(attrs[1]) + "\n"
rep = rep + "\tpassword " + str(attrs[2]) + "\n"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
    rep += f"\taccount {attrs[1]}\n"
rep += f"\tpassword {attrs[2]}\n"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

Copy link
Copy Markdown
Contributor Author

@methane, I updated this to use f-strings. Is there anything else that needs to be done for this to be merged?

methane commented Sep 16, 2017

Copy link
Copy Markdown
Member

Sorry for delay.
Would you add NEWS file and test?

methane commented Sep 16, 2017

Copy link
Copy Markdown
Member

See https://devguide.python.org/committing/#what-s-new-and-news-entries for how to create NEWS entry file.

Copy link
Copy Markdown
Contributor Author

@methane This is done. Let me know if it looks good!

methane merged commit b24cd05 into python:master Sep 30, 2017

methane commented Sep 30, 2017

Copy link
Copy Markdown
Member

Thanks.

sloria commented Nov 2, 2017

Copy link
Copy Markdown

Will this fix be backported to python 2.7? The issue exists there as well.

Copy link
Copy Markdown
Contributor

Thanks @Bezier89 for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 3, 2017
netrc file format doesn't support quotes and escapes.

See https://linux.die.net/man/5/netrc
(cherry picked from commit b24cd05)

Copy link
Copy Markdown

GH-4244 is a backport of this pull request to the 3.6 branch.

methane commented Nov 3, 2017

Copy link
Copy Markdown
Member

@sloria Will and will not.
This pull request need modify to backport to 2.7, since it using f-string.
If you create pull request for 2.7, please mention me. I'll see it.

sloria commented Nov 3, 2017

Copy link
Copy Markdown

I needed this fix, so I released a library that addresses this issue (and also adds write functionality): https://github.com/sloria/tinynetrc .

I can't make any promises, but if I get some time, I'll look into backporting to 2.7.

methane pushed a commit that referenced this pull request Nov 3, 2017
netrc file format doesn't support quotes and escapes.

See https://linux.die.net/man/5/netrc
(cherry picked from commit b24cd05)
sloria pushed a commit to sloria/cpython that referenced this pull request Nov 4, 2017

sloria commented Nov 4, 2017

Copy link
Copy Markdown

@methane OK, I've made a PR for 2.7: #4276

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL