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
8c4e112a
Kaydet (Commit)
8c4e112a
authored
Ara 25, 2014
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#23040: Clarify treatment of encoding and errors when component is bytes.
Patch by Wojtek Ruszczewski.
üst
a54f0750
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
urllib.parse.rst
Doc/library/urllib.parse.rst
+4
-3
parse.py
Lib/urllib/parse.py
+5
-4
No files found.
Doc/library/urllib.parse.rst
Dosyayı görüntüle @
8c4e112a
...
@@ -517,7 +517,7 @@ task isn't already covered by the URL parsing functions above.
...
@@ -517,7 +517,7 @@ task isn't already covered by the URL parsing functions above.
.. function:: urlencode(query, doseq=False, safe='', encoding=None, errors=None)
.. function:: urlencode(query, doseq=False, safe='', encoding=None, errors=None)
Convert a mapping object or a sequence of two-element tuples, which may
Convert a mapping object or a sequence of two-element tuples, which may
either be a :class:`str` or a :class:`bytes`,
to a "percent-encoded"
contain :class:`str` or :class:`bytes` objects,
to a "percent-encoded"
string. If the resultant string is to be used as a *data* for POST
string. If the resultant string is to be used as a *data* for POST
operation with :func:`~urllib.request.urlopen` function, then it should be
operation with :func:`~urllib.request.urlopen` function, then it should be
properly encoded to bytes, otherwise it would result in a :exc:`TypeError`.
properly encoded to bytes, otherwise it would result in a :exc:`TypeError`.
...
@@ -532,8 +532,9 @@ task isn't already covered by the URL parsing functions above.
...
@@ -532,8 +532,9 @@ task isn't already covered by the URL parsing functions above.
the value sequence for the key. The order of parameters in the encoded
the value sequence for the key. The order of parameters in the encoded
string will match the order of parameter tuples in the sequence.
string will match the order of parameter tuples in the sequence.
When *query* parameter is a :class:`str`, the *safe*, *encoding* and *error*
The *safe*, *encoding*, and *errors* parameters are passed down to
parameters are passed down to :func:`quote_plus` for encoding.
:func:`quote_plus` (the *encoding* and *errors* parameters are only passed
when a query element is a :class:`str`).
To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are
To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are
provided in this module to parse query strings into Python data structures.
provided in this module to parse query strings into Python data structures.
...
...
Lib/urllib/parse.py
Dosyayı görüntüle @
8c4e112a
...
@@ -670,8 +670,8 @@ def quote(string, safe='/', encoding=None, errors=None):
...
@@ -670,8 +670,8 @@ def quote(string, safe='/', encoding=None, errors=None):
called on a path where the existing slash characters are used as
called on a path where the existing slash characters are used as
reserved characters.
reserved characters.
string and safe may be either str or bytes objects. encoding
must
string and safe may be either str or bytes objects. encoding
and errors
not be specified if string is a str
.
must not be specified if string is a bytes object
.
The optional encoding and errors parameters specify how to deal with
The optional encoding and errors parameters specify how to deal with
non-ASCII characters, as accepted by the str.encode method.
non-ASCII characters, as accepted by the str.encode method.
...
@@ -743,8 +743,9 @@ def urlencode(query, doseq=False, safe='', encoding=None, errors=None):
...
@@ -743,8 +743,9 @@ def urlencode(query, doseq=False, safe='', encoding=None, errors=None):
input.
input.
The components of a query arg may each be either a string or a bytes type.
The components of a query arg may each be either a string or a bytes type.
When a component is a string, the safe, encoding and error parameters are
sent to the quote_plus function for encoding.
The safe, encoding, and errors parameters are passed down to quote_plus()
(encoding and errors only if a component is a str).
"""
"""
if
hasattr
(
query
,
"items"
):
if
hasattr
(
query
,
"items"
):
...
...
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