Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-28806: Improve the netrc library#127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
zhangyangyu wants to merge1 commit intopython:mainfromzhangyangyu:workspace

Conversation

zhangyangyu
Copy link
Member

No description provided.

yan12125, alindt, mszczepanczyk, and Sipty reacted with thumbs up emoji
@dmerejkowsky
Copy link

@zhangyangyu Nice work! I also wrote a tiny patch fornetrc, so maybe you could integrate#123 in your PR as well?

@zhangyangyu
Copy link
MemberAuthor

zhangyangyu commentedFeb 20, 2017
edited
Loading

@dmerejkowsky I wrote this patch months ago, so I have to spend some time picking it up to see if there is any possibility. Happy to see someone also interested in improving netrc.

@dmerejkowsky
Copy link

OK, then. Hopefully our PRs won't conflict with each other, so this not a big deal.

Keep up the good work!

akruis referenced this pull request in stackless-dev/stacklessSep 5, 2017
akruis referenced this pull request in stackless-dev/stacklessSep 5, 2017
akruis pushed a commit to akruis/cpython that referenced this pull requestSep 9, 2017
…tor and traceback objects__setstate__ must accept the state returned by __reduce__. This was not the case for generatorand trace-back objects. This commit fixes this. The next commit (merge of issuepython#127) adds the relevant test cases.Additionally amends changelog.txt.https://bitbucket.org/stackless-dev/stackless/issues/107
akruis pushed a commit to akruis/cpython that referenced this pull requestSep 9, 2017
akruis pushed a commit to akruis/cpython that referenced this pull requestSep 9, 2017
akruis pushed a commit to akruis/cpython that referenced this pull requestSep 9, 2017
…ling tests.This change is based on f5f98595c6cc63b from 2.7-slp, but it is heavily modified for Python 3.- Pickle 'callable-iterator' objects correctly. Previously the unpickled object had the type '_stackless._wrap.callable-iterator'.- Fix pickling of 'method-wrapper' objects. Previously pickling them caused a SystemError exception.- Fix copy.copy() for 'callable-iterator', 'method', 'dict_keys', 'dict_values' and 'dict_items' objects. Previously the copied object had the type '_stackless._wrap....'.- Fix Stackless pickling tests. The method StacklessTestCase.dumps() didn't pass the pickle protocol to the pickler.- Remove dead code in prickelpit.c. The code was used in older Stackless versions.
akruis pushed a commit to akruis/cpython that referenced this pull requestSep 9, 2017
…iterator'Disable the Stackless specific code for pickling 'iterator' and 'callable_iterator' objects. C-Python 3.3 already pickles them.Add tests to ensure, that Stackless can still unpickle old pickles.https://bitbucket.org/stackless-dev/stackless/issues/127
akruis pushed a commit to akruis/cpython that referenced this pull requestOct 10, 2017
akruis pushed a commit to akruis/cpython that referenced this pull requestOct 10, 2017
elif tt == 'login' or tt == 'user':
login = lexer.get_token()
elif tt == 'account':
account = lexer.get_token()
elif tt == 'password':
if os.name == 'posix' and default_netrc:
if os.name == 'posix' and default_netrc and login != "anonymous":

Choose a reason for hiding this comment

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

This assumes that login has already been parsed, but the netrc format does not require providing login token before password token. It would be better to perform this check on storing parsed data into self.hosts[entryname], when all machine-related data is parsed and available.

thedrow reacted with thumbs up emoji
Copy link

@auvipyauvipy left a comment

Choose a reason for hiding this comment

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

also please re base

@@ -32,6 +32,12 @@ the Unix :program:`ftp` program and other FTP clients.

.. versionchanged:: 3.4 Added the POSIX permission check.

.. versionchanged:: 3.7

Choose a reason for hiding this comment

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

3.8

Choose a reason for hiding this comment

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

you can retarget it for python 3.9

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

I'm not sure, but it may be worth to backport these changes to maintained versions. It fixes several bugs in the.netrc file parsing.

@@ -32,6 +32,12 @@ the Unix :program:`ftp` program and other FTP clients.

.. versionchanged:: 3.4 Added the POSIX permission check.

.. versionchanged:: 3.7

Choose a reason for hiding this comment

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

3.8

continue
if ch == "\"":
for ch in fiter:
if ch != "\"":

Choose a reason for hiding this comment

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

I would revert this condition.

ifch=='"':returntoken

And removedcontinue.

thedrow reacted with thumbs up emoji
self.lineno = 1
self.instream = fp
self.whitespace = "\n\t\r "
self._stack = []

Choose a reason for hiding this comment

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

It is not a stack, it is a queue. I suggest to rename it topushback, as inshlex.lexer.

for ch in fiter:
if ch in self.whitespace:
continue
if ch == "\"":

Choose a reason for hiding this comment

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

'"'?

thedrow reacted with thumbs up emoji
ch = self._read_char()
token += ch
for ch in fiter:
if ch not in self.whitespace:

Choose a reason for hiding this comment

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

The same as above.

thedrow reacted with thumbs up emoji
lexer.instream.readline()
continue
elif tt == 'machine':
entryname = lexer.get_token()
elif tt == 'default':
entryname = 'default'
elif tt == 'macdef': # Just skip to end of macdefs
elif tt == 'macdef':
entryname = lexer.get_token()

Choose a reason for hiding this comment

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

You need to read and ignore the rest of the line after the macro name.

raise NetrcParseError(
"Macro definition missing null line terminator.",
file, lexer.lineno)
if line == '\n':

Choose a reason for hiding this comment

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

Add a comment.

thedrow reacted with thumbs up emoji
@@ -127,10 +172,10 @@ def __repr__(self):
rep = ""
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 " + attrs[0] + "\n"

Choose a reason for hiding this comment

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

Perhaps we need a special function which escapes whitespaces and other special characters?

ch = self._read_char()
token += ch
for ch in fiter:
if ch not in self.whitespace:

Choose a reason for hiding this comment

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

I suggest to add a flag for denoting whether the terminating whitespace was'\n'. It will be helpful for comments andmacdef.

thedrow reacted with thumbs up emoji
@csabella
Copy link
Contributor

@zhangyangyu, would you be able to address Serhiy's review from October? Thanks!

@zhangyangyu
Copy link
MemberAuthor

@csabella I am busy in my job now and this issue has been a long time even myself needs to reacquaint with it. But October seems not that hard to me. Is 3.8 going to release on October?

@csabella
Copy link
Contributor

@zhangyangyu, sorry, I meant that Serhiy had left a comment last October, not that this needs to be looked at before the next October. The cutoff for 3.8 is this coming Monday (2019-06-03). I hope you still find time to look at it in the next few months. Thanks!

@eamanu
Copy link
Contributor

Hello I can continue this PR if your consider good.

Cc@csabella

@eamanu
Copy link
Contributor

Hi@auvipy@csabella@zhangyangyu There is some plan with this PR?
Was open 3 years ago. If the author is still interested on this bugs
resolution we could open a new PR.

What's your opinion?

@HighnessAtharva
Copy link

So should this PR be closed?

@nanjekyejoannah
Copy link
Contributor

Closing this PR since anotherPR #26330 continues and addresses comments on this thread. All reviews should move to the new PR.

thedrow reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@raspyraspyraspy left review comments

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@auvipyauvipyauvipy left review comments

Assignees
No one assigned
Labels
awaiting reviewtype-featureA feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

11 participants
@zhangyangyu@dmerejkowsky@csabella@eamanu@HighnessAtharva@nanjekyejoannah@raspy@serhiy-storchaka@auvipy@Mariatta@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp