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
faf4149f
Kaydet (Commit)
faf4149f
authored
May 26, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#6118: dont ignore encoding arguments for arguments with spaces in quote_plus().
üst
8ca69de2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
test_urllib.py
Lib/test/test_urllib.py
+15
-0
parse.py
Lib/urllib/parse.py
+1
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
faf4149f
...
...
@@ -510,6 +510,21 @@ class QuotingTests(unittest.TestCase):
self
.
assertEqual
(
expect
,
result
,
"using quote():
%
r !=
%
r"
%
(
expect
,
result
))
def
test_quote_plus_with_unicode
(
self
):
# Encoding (latin-1) test for quote_plus
given
=
"
\xa2\xd8
\xff
"
expect
=
"
%
A2
%
D8+
%
FF"
result
=
urllib
.
parse
.
quote_plus
(
given
,
encoding
=
"latin-1"
)
self
.
assertEqual
(
expect
,
result
,
"using quote_plus():
%
r !=
%
r"
%
(
expect
,
result
))
# Errors test for quote_plus
given
=
"ab
\u6f22\u5b57
cd"
expect
=
"ab
%3
F
%3
F+cd"
result
=
urllib
.
parse
.
quote_plus
(
given
,
encoding
=
"latin-1"
,
errors
=
"replace"
)
self
.
assertEqual
(
expect
,
result
,
"using quote_plus():
%
r !=
%
r"
%
(
expect
,
result
))
class
UnquotingTests
(
unittest
.
TestCase
):
"""Tests for unquote() and unquote_plus()
...
...
Lib/urllib/parse.py
Dosyayı görüntüle @
faf4149f
...
...
@@ -488,7 +488,7 @@ def quote_plus(string, safe='', encoding=None, errors=None):
space
=
' '
else
:
space
=
b
' '
string
=
quote
(
string
,
safe
+
space
)
string
=
quote
(
string
,
safe
+
space
,
encoding
,
errors
)
return
string
.
replace
(
' '
,
'+'
)
def
quote_from_bytes
(
bs
,
safe
=
'/'
):
...
...
Misc/NEWS
Dosyayı görüntüle @
faf4149f
...
...
@@ -34,6 +34,9 @@ Core and Builtins
Library
-------
- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
arguments for strings with a space in them.
- In unittest, using a skipping decorator on a class is now equivalent to
skipping every test on the class. The ClassTestSuite class has been removed.
...
...
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