Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6f9e3ca5
Kaydet (Commit)
6f9e3ca5
authored
Agu 24, 2005
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backport 1.74
üst
d2b70913
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
ftplib.py
Lib/ftplib.py
+16
-7
No files found.
Lib/ftplib.py
Dosyayı görüntüle @
6f9e3ca5
...
@@ -208,13 +208,13 @@ class FTP:
...
@@ -208,13 +208,13 @@ class FTP:
if
self
.
debugging
:
print
'*resp*'
,
self
.
sanitize
(
resp
)
if
self
.
debugging
:
print
'*resp*'
,
self
.
sanitize
(
resp
)
self
.
lastresp
=
resp
[:
3
]
self
.
lastresp
=
resp
[:
3
]
c
=
resp
[:
1
]
c
=
resp
[:
1
]
if
c
in
(
'1'
,
'2'
,
'3'
):
return
resp
if
c
==
'4'
:
if
c
==
'4'
:
raise
error_temp
,
resp
raise
error_temp
,
resp
if
c
==
'5'
:
if
c
==
'5'
:
raise
error_perm
,
resp
raise
error_perm
,
resp
if
c
not
in
'123'
:
raise
error_proto
,
resp
raise
error_proto
,
resp
return
resp
def
voidresp
(
self
):
def
voidresp
(
self
):
"""Expect a response beginning with '2'."""
"""Expect a response beginning with '2'."""
...
@@ -582,17 +582,17 @@ def parse229(resp, peer):
...
@@ -582,17 +582,17 @@ def parse229(resp, peer):
Raises error_proto if it does not contain '(|||port|)'
Raises error_proto if it does not contain '(|||port|)'
Return ('host.addr.as.numbers', port#) tuple.'''
Return ('host.addr.as.numbers', port#) tuple.'''
if
resp
[:
3
]
<>
'229'
:
if
resp
[:
3
]
!=
'229'
:
raise
error_reply
,
resp
raise
error_reply
,
resp
left
=
resp
.
find
(
'('
)
left
=
resp
.
find
(
'('
)
if
left
<
0
:
raise
error_proto
,
resp
if
left
<
0
:
raise
error_proto
,
resp
right
=
resp
.
find
(
')'
,
left
+
1
)
right
=
resp
.
find
(
')'
,
left
+
1
)
if
right
<
0
:
if
right
<
0
:
raise
error_proto
,
resp
# should contain '(|||port|)'
raise
error_proto
,
resp
# should contain '(|||port|)'
if
resp
[
left
+
1
]
<>
resp
[
right
-
1
]:
if
resp
[
left
+
1
]
!=
resp
[
right
-
1
]:
raise
error_proto
,
resp
raise
error_proto
,
resp
parts
=
resp
[
left
+
1
:
right
]
.
split
(
resp
[
left
+
1
])
parts
=
resp
[
left
+
1
:
right
]
.
split
(
resp
[
left
+
1
])
if
len
(
parts
)
<>
5
:
if
len
(
parts
)
!=
5
:
raise
error_proto
,
resp
raise
error_proto
,
resp
host
=
peer
[
0
]
host
=
peer
[
0
]
port
=
int
(
parts
[
3
])
port
=
int
(
parts
[
3
])
...
@@ -755,7 +755,16 @@ class Netrc:
...
@@ -755,7 +755,16 @@ class Netrc:
def
test
():
def
test
():
'''Test program.
'''Test program.
Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...'''
Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
-d dir
-l list
-p password
'''
if
len
(
sys
.
argv
)
<
2
:
print
test
.
__doc__
sys
.
exit
(
0
)
debugging
=
0
debugging
=
0
rcfile
=
None
rcfile
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment