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
7cc0fe44
Kaydet (Commit)
7cc0fe44
authored
Agu 11, 2010
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix Issue9446 - urllib2 tests fail when offline
üst
cb4f47c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
urllib2.py
Lib/urllib2.py
+7
-1
No files found.
Lib/urllib2.py
Dosyayı görüntüle @
7cc0fe44
...
...
@@ -1259,6 +1259,12 @@ def parse_http_list(s):
return
[
part
.
strip
()
for
part
in
res
]
def
_safe_gethostbyname
(
host
):
try
:
return
socket
.
gethostbyname
(
host
)
except
socket
.
gaierror
:
return
None
class
FileHandler
(
BaseHandler
):
# Use local file or FTP depending on form of URL
def
file_open
(
self
,
req
):
...
...
@@ -1300,7 +1306,7 @@ class FileHandler(BaseHandler):
if
host
:
host
,
port
=
splitport
(
host
)
if
not
host
or
\
(
not
port
and
socket
.
gethostbyname
(
host
)
in
self
.
get_names
()):
(
not
port
and
_safe_
gethostbyname
(
host
)
in
self
.
get_names
()):
if
host
:
origurl
=
'file://'
+
host
+
filename
else
:
...
...
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