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
a27244bf
Kaydet (Commit)
a27244bf
authored
Eyl 09, 2008
tarafından
Facundo Batista
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added a warning filter to don't show the warning during
the tests. Also fixed the warning message in cgi.py
üst
1cd0247a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
cgi.py
Lib/cgi.py
+1
-1
test_cgi.py
Lib/test/test_cgi.py
+13
-4
No files found.
Lib/cgi.py
Dosyayı görüntüle @
a27244bf
...
@@ -168,7 +168,7 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
...
@@ -168,7 +168,7 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
def
parse_qsl
(
qs
,
keep_blank_values
=
0
,
strict_parsing
=
0
):
def
parse_qsl
(
qs
,
keep_blank_values
=
0
,
strict_parsing
=
0
):
"""Parse a query given as a string argument."""
"""Parse a query given as a string argument."""
warn
(
"cgi.parse_qsl is deprecated, use urllib.parse.parse_qs instead"
,
warn
(
"cgi.parse_qsl is deprecated, use urllib.parse.parse_qs
l
instead"
,
DeprecationWarning
)
DeprecationWarning
)
return
urllib
.
parse
.
parse_qsl
(
qs
,
keep_blank_values
,
strict_parsing
)
return
urllib
.
parse
.
parse_qsl
(
qs
,
keep_blank_values
,
strict_parsing
)
...
...
Lib/test/test_cgi.py
Dosyayı görüntüle @
a27244bf
...
@@ -5,6 +5,7 @@ import sys
...
@@ -5,6 +5,7 @@ import sys
import
tempfile
import
tempfile
import
unittest
import
unittest
from
io
import
StringIO
from
io
import
StringIO
from
warnings
import
catch_warnings
,
filterwarnings
class
HackedSysModule
:
class
HackedSysModule
:
# The regression test will have real values in sys.argv, which
# The regression test will have real values in sys.argv, which
...
@@ -308,13 +309,21 @@ this is the content of the fake file
...
@@ -308,13 +309,21 @@ this is the content of the fake file
def
test_deprecated_parse_qs
(
self
):
def
test_deprecated_parse_qs
(
self
):
# this func is moved to urlparse, this is just a sanity check
# this func is moved to urlparse, this is just a sanity check
self
.
assertEqual
({
'a'
:
[
'A1'
],
'B'
:
[
'B3'
],
'b'
:
[
'B2'
]},
with
catch_warnings
():
cgi
.
parse_qs
(
'a=A1&b=B2&B=B3'
))
filterwarnings
(
'ignore'
,
'cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead'
,
DeprecationWarning
)
self
.
assertEqual
({
'a'
:
[
'A1'
],
'B'
:
[
'B3'
],
'b'
:
[
'B2'
]},
cgi
.
parse_qs
(
'a=A1&b=B2&B=B3'
))
def
test_deprecated_parse_qsl
(
self
):
def
test_deprecated_parse_qsl
(
self
):
# this func is moved to urlparse, this is just a sanity check
# this func is moved to urlparse, this is just a sanity check
self
.
assertEqual
([(
'a'
,
'A1'
),
(
'b'
,
'B2'
),
(
'B'
,
'B3'
)],
with
catch_warnings
():
cgi
.
parse_qsl
(
'a=A1&b=B2&B=B3'
))
filterwarnings
(
'ignore'
,
'cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead'
,
DeprecationWarning
)
self
.
assertEqual
([(
'a'
,
'A1'
),
(
'b'
,
'B2'
),
(
'B'
,
'B3'
)],
cgi
.
parse_qsl
(
'a=A1&b=B2&B=B3'
))
def
test_main
():
def
test_main
():
run_unittest
(
CgiTests
)
run_unittest
(
CgiTests
)
...
...
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