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
f577686f
Kaydet (Commit)
f577686f
authored
Eki 21, 2012
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10836: Fix exception raised when file not found in urlretrieve
üst
8a915499
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
test_urllib.py
Lib/test/test_urllib.py
+5
-0
request.py
Lib/urllib/request.py
+2
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
f577686f
...
...
@@ -268,6 +268,11 @@ Content-Type: text/html; charset=iso-8859-1
finally
:
self
.
unfakehttp
()
def
test_missing_localfile
(
self
):
# Test for #10836
with
self
.
assertRaises
(
urllib
.
error
.
URLError
):
urlopen
(
'file://localhost/a/file/which/doesnot/exists.py'
)
def
test_userpass_inurl
(
self
):
self
.
fakehttp
(
b
"HTTP/1.0 200 OK
\r\n\r\n
Hello!"
)
try
:
...
...
Lib/urllib/request.py
Dosyayı görüntüle @
f577686f
...
...
@@ -1664,7 +1664,7 @@ class URLopener:
return
getattr
(
self
,
name
)(
url
)
else
:
return
getattr
(
self
,
name
)(
url
,
data
)
except
HTTPError
:
except
(
HTTPError
,
URLError
)
:
raise
except
socket
.
error
as
msg
:
raise
IOError
(
'socket error'
,
msg
)
.
with_traceback
(
sys
.
exc_info
()[
2
])
...
...
@@ -1891,7 +1891,7 @@ class URLopener:
try
:
stats
=
os
.
stat
(
localname
)
except
OSError
as
e
:
raise
URLError
(
e
.
errno
,
e
.
strerror
,
e
.
filename
)
raise
URLError
(
e
.
strerror
,
e
.
filename
)
size
=
stats
.
st_size
modified
=
email
.
utils
.
formatdate
(
stats
.
st_mtime
,
usegmt
=
True
)
mtype
=
mimetypes
.
guess_type
(
url
)[
0
]
...
...
Misc/NEWS
Dosyayı görüntüle @
f577686f
...
...
@@ -59,6 +59,9 @@ Core and Builtins
Library
-------
-
Issue
#
10836
:
Fix
exception
raised
when
file
not
found
in
urlretrieve
Initial
patch
by
Ezio
Melotti
.
-
Issue
#
14398
:
Fix
size
truncation
and
overflow
bugs
in
the
bz2
module
.
-
Issue
#
12692
:
Fix
resource
leak
in
urllib
.
request
when
talking
to
an
HTTP
...
...
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