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
79b99dba
Kaydet (Commit)
79b99dba
authored
Şub 21, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Silence DeprecationWarnings in test_urllib.
üst
6f43a909
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
test_urllib.py
Lib/test/test_urllib.py
+14
-9
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
79b99dba
...
@@ -30,7 +30,10 @@ def urlopen(url, data=None, proxies=None):
...
@@ -30,7 +30,10 @@ def urlopen(url, data=None, proxies=None):
if
proxies
is
not
None
:
if
proxies
is
not
None
:
opener
=
urllib
.
request
.
FancyURLopener
(
proxies
=
proxies
)
opener
=
urllib
.
request
.
FancyURLopener
(
proxies
=
proxies
)
elif
not
_urlopener
:
elif
not
_urlopener
:
opener
=
urllib
.
request
.
FancyURLopener
()
with
support
.
check_warnings
(
(
'FancyURLopener style of invoking requests is deprecated.'
,
DeprecationWarning
)):
opener
=
urllib
.
request
.
FancyURLopener
()
_urlopener
=
opener
_urlopener
=
opener
else
:
else
:
opener
=
_urlopener
opener
=
_urlopener
...
@@ -1196,14 +1199,16 @@ class URLopener_Tests(unittest.TestCase):
...
@@ -1196,14 +1199,16 @@ class URLopener_Tests(unittest.TestCase):
class
DummyURLopener
(
urllib
.
request
.
URLopener
):
class
DummyURLopener
(
urllib
.
request
.
URLopener
):
def
open_spam
(
self
,
url
):
def
open_spam
(
self
,
url
):
return
url
return
url
with
support
.
check_warnings
(
self
.
assertEqual
(
DummyURLopener
()
.
open
(
(
'DummyURLopener style of invoking requests is deprecated.'
,
'spam://example/ /'
),
'//example/
%20
/'
)
DeprecationWarning
)):
self
.
assertEqual
(
DummyURLopener
()
.
open
(
# test the safe characters are not quoted by urlopen
'spam://example/ /'
),
'//example/
%20
/'
)
self
.
assertEqual
(
DummyURLopener
()
.
open
(
"spam://c:|windows
%
/:=&?~#+!$,;'@()*[]|/path/"
),
# test the safe characters are not quoted by urlopen
"//c:|windows
%
/:=&?~#+!$,;'@()*[]|/path/"
)
self
.
assertEqual
(
DummyURLopener
()
.
open
(
"spam://c:|windows
%
/:=&?~#+!$,;'@()*[]|/path/"
),
"//c:|windows
%
/:=&?~#+!$,;'@()*[]|/path/"
)
# Just commented them out.
# Just commented them out.
# Can't really tell why keep failing in windows and sparc.
# Can't really tell why keep failing in windows and sparc.
...
...
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