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
80f1b059
Kaydet (Commit)
80f1b059
authored
Haz 18, 2010
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix Issue1368368 - prompt_user_passwd() in FancyURLopener masks 401 Unauthorized error page
üst
2cd12528
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
request.py
Lib/urllib/request.py
+10
-2
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/urllib/request.py
Dosyayı görüntüle @
80f1b059
...
@@ -1866,7 +1866,8 @@ class FancyURLopener(URLopener):
...
@@ -1866,7 +1866,8 @@ class FancyURLopener(URLopener):
else
:
else
:
return
self
.
http_error_default
(
url
,
fp
,
errcode
,
errmsg
,
headers
)
return
self
.
http_error_default
(
url
,
fp
,
errcode
,
errmsg
,
headers
)
def
http_error_401
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
,
data
=
None
):
def
http_error_401
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
,
data
=
None
,
retry
=
False
):
"""Error 401 -- authentication required.
"""Error 401 -- authentication required.
This function supports Basic authentication only."""
This function supports Basic authentication only."""
if
not
'www-authenticate'
in
headers
:
if
not
'www-authenticate'
in
headers
:
...
@@ -1882,13 +1883,17 @@ class FancyURLopener(URLopener):
...
@@ -1882,13 +1883,17 @@ class FancyURLopener(URLopener):
if
scheme
.
lower
()
!=
'basic'
:
if
scheme
.
lower
()
!=
'basic'
:
URLopener
.
http_error_default
(
self
,
url
,
fp
,
URLopener
.
http_error_default
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
)
errcode
,
errmsg
,
headers
)
if
not
retry
:
URLopener
.
http_error_default
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
)
name
=
'retry_'
+
self
.
type
+
'_basic_auth'
name
=
'retry_'
+
self
.
type
+
'_basic_auth'
if
data
is
None
:
if
data
is
None
:
return
getattr
(
self
,
name
)(
url
,
realm
)
return
getattr
(
self
,
name
)(
url
,
realm
)
else
:
else
:
return
getattr
(
self
,
name
)(
url
,
realm
,
data
)
return
getattr
(
self
,
name
)(
url
,
realm
,
data
)
def
http_error_407
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
,
data
=
None
):
def
http_error_407
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
,
data
=
None
,
retry
=
False
):
"""Error 407 -- proxy authentication required.
"""Error 407 -- proxy authentication required.
This function supports Basic authentication only."""
This function supports Basic authentication only."""
if
not
'proxy-authenticate'
in
headers
:
if
not
'proxy-authenticate'
in
headers
:
...
@@ -1904,6 +1909,9 @@ class FancyURLopener(URLopener):
...
@@ -1904,6 +1909,9 @@ class FancyURLopener(URLopener):
if
scheme
.
lower
()
!=
'basic'
:
if
scheme
.
lower
()
!=
'basic'
:
URLopener
.
http_error_default
(
self
,
url
,
fp
,
URLopener
.
http_error_default
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
)
errcode
,
errmsg
,
headers
)
if
not
retry
:
URLopener
.
http_error_default
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
)
name
=
'retry_proxy_'
+
self
.
type
+
'_basic_auth'
name
=
'retry_proxy_'
+
self
.
type
+
'_basic_auth'
if
data
is
None
:
if
data
is
None
:
return
getattr
(
self
,
name
)(
url
,
realm
)
return
getattr
(
self
,
name
)(
url
,
realm
)
...
...
Misc/NEWS
Dosyayı görüntüle @
80f1b059
...
@@ -446,6 +446,10 @@ C-API
...
@@ -446,6 +446,10 @@ C-API
Library
Library
-------
-------
- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
password instead of presenting an interactive prompt. Older behavior can be
obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
- Issue #8720: fix regression caused by fix for #4050 by making getsourcefile
- Issue #8720: fix regression caused by fix for #4050 by making getsourcefile
smart enough to find source files in the linecache.
smart enough to find source files in the linecache.
...
...
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