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

Commitefa3b51

Browse files
alanyeemiss-islington
authored andcommitted
Enforce PEP 257 conventions in ftplib.py (GH-15604)
-`"""` over `'''`-no blank line either before or after the docstring.-place the closing quotes on a line by themselves
1 parente1786b5 commitefa3b51

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

‎Lib/ftplib.py‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class error_proto(Error): pass # response does not begin with [1-5]
7272

7373
# The class itself
7474
classFTP:
75-
7675
'''An FTP client class.
7776
7877
To create a connection, call the class using these arguments:
@@ -105,12 +104,13 @@ class FTP:
105104
passiveserver=1
106105
encoding="latin-1"
107106

108-
# Initialization method (called by class instantiation).
109-
# Initialize host to localhost, port to standard ftp port
110-
# Optional arguments are host (for connect()),
111-
# and user, passwd, acct (for login())
112107
def__init__(self,host='',user='',passwd='',acct='',
113108
timeout=_GLOBAL_DEFAULT_TIMEOUT,source_address=None):
109+
"""Initialization method (called by class instantiation).
110+
Initialize host to localhost, port to standard ftp port.
111+
Optional arguments are host (for connect()),
112+
and user, passwd, acct (for login()).
113+
"""
114114
self.source_address=source_address
115115
self.timeout=timeout
116116
ifhost:
@@ -823,7 +823,6 @@ def parse227(resp):
823823
'''Parse the '227' response for a PASV request.
824824
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
825825
Return ('host.addr.as.numbers', port#) tuple.'''
826-
827826
ifresp[:3]!='227':
828827
raiseerror_reply(resp)
829828
global_227_re
@@ -843,7 +842,6 @@ def parse229(resp, peer):
843842
'''Parse the '229' response for an EPSV request.
844843
Raises error_proto if it does not contain '(|||port|)'
845844
Return ('host.addr.as.numbers', port#) tuple.'''
846-
847845
ifresp[:3]!='229':
848846
raiseerror_reply(resp)
849847
left=resp.find('(')
@@ -865,7 +863,6 @@ def parse257(resp):
865863
'''Parse the '257' response for a MKD or PWD request.
866864
This is a response to a MKD or PWD request: a directory name.
867865
Returns the directoryname in the 257 reply.'''
868-
869866
ifresp[:3]!='257':
870867
raiseerror_reply(resp)
871868
ifresp[3:5]!=' "':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp