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
f819886a
Kaydet (Commit)
f819886a
authored
Mar 26, 2009
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify a few complicated expressions.
üst
a4de60a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
parse.py
Lib/urllib/parse.py
+12
-7
No files found.
Lib/urllib/parse.py
Dosyayı görüntüle @
f819886a
...
...
@@ -479,12 +479,17 @@ def quote_plus(string, safe='', encoding=None, errors=None):
HTML form values. Plus signs in the original string are escaped unless
they are included in safe. It also does not have safe default to '/'.
"""
# Check if ' ' in string, where string may either be a str or bytes
if
' '
in
string
if
isinstance
(
string
,
str
)
else
b
' '
in
string
:
string
=
quote
(
string
,
safe
+
' '
if
isinstance
(
safe
,
str
)
else
safe
+
b
' '
)
return
string
.
replace
(
' '
,
'+'
)
return
quote
(
string
,
safe
,
encoding
,
errors
)
# Check if ' ' in string, where string may either be a str or bytes. If
# there are no spaces, the regular quote will produce the right answer.
if
((
isinstance
(
string
,
str
)
and
' '
not
in
string
)
or
(
isinstance
(
string
,
bytes
)
and
b
' '
not
in
string
)):
return
quote
(
string
,
safe
,
encoding
,
errors
)
if
isinstance
(
safe
,
str
):
space
=
' '
else
:
space
=
b
' '
string
=
quote
(
string
,
safe
+
space
)
return
string
.
replace
(
' '
,
'+'
)
def
quote_from_bytes
(
bs
,
safe
=
'/'
):
"""Like quote(), but accepts a bytes object rather than a str, and does
...
...
@@ -502,7 +507,7 @@ def quote_from_bytes(bs, safe='/'):
except
KeyError
:
quoter
=
Quoter
(
safe
)
_safe_quoters
[
cachekey
]
=
quoter
return
''
.
join
(
map
(
quoter
.
__getitem__
,
bs
)
)
return
''
.
join
(
[
quoter
[
char
]
for
char
in
bs
]
)
def
urlencode
(
query
,
doseq
=
0
):
"""Encode a sequence of two-element tuples or dictionary into a URL query string.
...
...
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