Repository navigation
Enforce PEP 257 conventions in ftplib.py #15604
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,7 +72,6 @@ class error_proto(Error): pass # response does not begin with [1-5] | |
|
|
||
| # The class itself | ||
| class FTP: | ||
|
|
||
| '''An FTP client class. | ||
|
|
||
| To create a connection, call the class using these arguments: | ||
|
|
@@ -105,12 +104,13 @@ class FTP: | |
| passiveserver = 1 | ||
| encoding = "latin-1" | ||
|
|
||
| # Initialization method (called by class instantiation). | ||
| # Initialize host to localhost, port to standard ftp port | ||
| # Optional arguments are host (for connect()), | ||
| # and user, passwd, acct (for login()) | ||
| def __init__(self, host='', user='', passwd='', acct='', | ||
| timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None): | ||
| """Initialization method (called by class instantiation). | ||
| Initialize host to localhost, port to standard ftp port | ||
| Optional arguments are host (for connect()), | ||
| and user, passwd, acct (for login()) | ||
|
alanyee marked this conversation as resolved.
Outdated
|
||
| """ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is good, |
||
| self.source_address = source_address | ||
| self.timeout = timeout | ||
| if host: | ||
|
|
@@ -823,7 +823,6 @@ def parse227(resp): | |
| '''Parse the '227' response for a PASV request. | ||
| Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)' | ||
| Return ('host.addr.as.numbers', port#) tuple.''' | ||
|
|
||
| if resp[:3] != '227': | ||
| raise error_reply(resp) | ||
| global _227_re | ||
|
|
@@ -843,7 +842,6 @@ def parse229(resp, peer): | |
| '''Parse the '229' response for an EPSV request. | ||
| Raises error_proto if it does not contain '(|||port|)' | ||
| Return ('host.addr.as.numbers', port#) tuple.''' | ||
|
|
||
| if resp[:3] != '229': | ||
| raise error_reply(resp) | ||
| left = resp.find('(') | ||
|
|
@@ -865,7 +863,6 @@ def parse257(resp): | |
| '''Parse the '257' response for a MKD or PWD request. | ||
| This is a response to a MKD or PWD request: a directory name. | ||
| Returns the directoryname in the 257 reply.''' | ||
|
|
||
| if resp[:3] != '257': | ||
| raise error_reply(resp) | ||
| if resp[3:5] != ' "': | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.