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
ae9ee732
Kaydet (Commit)
ae9ee732
authored
Haz 12, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use the getpass module instead of having platform-specific echo on/off
code here.
üst
c8f859a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
18 deletions
+5
-18
urllib.py
Lib/urllib.py
+5
-18
No files found.
Lib/urllib.py
Dosyayı görüntüle @
ae9ee732
...
...
@@ -476,30 +476,17 @@ class FancyURLopener(URLopener):
def
prompt_user_passwd
(
self
,
host
,
realm
):
# Override this in a GUI environment!
import
getpass
try
:
user
=
raw_input
(
"Enter username for
%
s at
%
s: "
%
(
realm
,
host
))
self
.
echo_off
()
try
:
passwd
=
raw_input
(
"Enter password for
%
s in
%
s at
%
s: "
%
(
user
,
realm
,
host
))
finally
:
self
.
echo_on
()
passwd
=
getpass
.
getpass
(
"Enter password for
%
s in
%
s at
%
s: "
%
(
user
,
realm
,
host
))
return
user
,
passwd
except
KeyboardInterrupt
:
return
None
,
None
def
echo_off
(
self
):
# XXX Is this sufficient???
if
hasattr
(
os
,
"system"
):
os
.
system
(
"stty -echo"
)
def
echo_on
(
self
):
# XXX Is this sufficient???
if
hasattr
(
os
,
"system"
):
print
os
.
system
(
"stty echo"
)
return
None
,
None
# Utility functions
...
...
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