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
2a5a26c8
Kaydet (Commit)
2a5a26c8
authored
Tem 27, 2017
tarafından
Dong-hee Na
Kaydeden (comit)
larryhastings
Tem 27, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[3.4] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command (#1214) (#2893)
üst
5c673dd2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
ftplib.py
Lib/ftplib.py
+2
-0
test_ftplib.py
Lib/test/test_ftplib.py
+5
-1
2017-07-26-21-50-13.bpo-30119.DZ6C_S.rst
...S.d/next/Library/2017-07-26-21-50-13.bpo-30119.DZ6C_S.rst
+2
-0
No files found.
Lib/ftplib.py
Dosyayı görüntüle @
2a5a26c8
...
@@ -187,6 +187,8 @@ class FTP:
...
@@ -187,6 +187,8 @@ class FTP:
# Internal: send one line to the server, appending CRLF
# Internal: send one line to the server, appending CRLF
def
putline
(
self
,
line
):
def
putline
(
self
,
line
):
if
'
\r
'
in
line
or
'
\n
'
in
line
:
raise
ValueError
(
'an illegal newline character should not be contained'
)
line
=
line
+
CRLF
line
=
line
+
CRLF
if
self
.
debugging
>
1
:
if
self
.
debugging
>
1
:
print
(
'*put*'
,
self
.
sanitize
(
line
))
print
(
'*put*'
,
self
.
sanitize
(
line
))
...
...
Lib/test/test_ftplib.py
Dosyayı görüntüle @
2a5a26c8
...
@@ -482,6 +482,9 @@ class TestFTPClass(TestCase):
...
@@ -482,6 +482,9 @@ class TestFTPClass(TestCase):
self
.
assertEqual
(
self
.
client
.
sanitize
(
'PASS 12345'
),
repr
(
'PASS *****'
))
self
.
assertEqual
(
self
.
client
.
sanitize
(
'PASS 12345'
),
repr
(
'PASS *****'
))
def
test_exceptions
(
self
):
def
test_exceptions
(
self
):
self
.
assertRaises
(
ValueError
,
self
.
client
.
sendcmd
,
'echo 40
\r\n
0'
)
self
.
assertRaises
(
ValueError
,
self
.
client
.
sendcmd
,
'echo 40
\n
0'
)
self
.
assertRaises
(
ValueError
,
self
.
client
.
sendcmd
,
'echo 40
\r
0'
)
self
.
assertRaises
(
ftplib
.
error_temp
,
self
.
client
.
sendcmd
,
'echo 400'
)
self
.
assertRaises
(
ftplib
.
error_temp
,
self
.
client
.
sendcmd
,
'echo 400'
)
self
.
assertRaises
(
ftplib
.
error_temp
,
self
.
client
.
sendcmd
,
'echo 499'
)
self
.
assertRaises
(
ftplib
.
error_temp
,
self
.
client
.
sendcmd
,
'echo 499'
)
self
.
assertRaises
(
ftplib
.
error_perm
,
self
.
client
.
sendcmd
,
'echo 500'
)
self
.
assertRaises
(
ftplib
.
error_perm
,
self
.
client
.
sendcmd
,
'echo 500'
)
...
@@ -490,7 +493,8 @@ class TestFTPClass(TestCase):
...
@@ -490,7 +493,8 @@ class TestFTPClass(TestCase):
def
test_all_errors
(
self
):
def
test_all_errors
(
self
):
exceptions
=
(
ftplib
.
error_reply
,
ftplib
.
error_temp
,
ftplib
.
error_perm
,
exceptions
=
(
ftplib
.
error_reply
,
ftplib
.
error_temp
,
ftplib
.
error_perm
,
ftplib
.
error_proto
,
ftplib
.
Error
,
OSError
,
EOFError
)
ftplib
.
error_proto
,
ftplib
.
Error
,
OSError
,
EOFError
)
for
x
in
exceptions
:
for
x
in
exceptions
:
try
:
try
:
raise
x
(
'exception not included in all_errors set'
)
raise
x
(
'exception not included in all_errors set'
)
...
...
Misc/NEWS.d/next/Library/2017-07-26-21-50-13.bpo-30119.DZ6C_S.rst
0 → 100644
Dosyayı görüntüle @
2a5a26c8
ftplib.FTP.putline() now throws ValueError on commands that contains CR or
LF. Patch by Dong-hee Na.
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