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
40b9835e
Kaydet (Commit)
40b9835e
authored
Ock 19, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Always use 'anonymous' if os.environ doesn't exist
üst
c39f4f89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
ftplib.py
Lib/ftplib.py
+10
-5
No files found.
Lib/ftplib.py
Dosyayı görüntüle @
40b9835e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# (FTP), by J. Postel and J. Reynolds
# (FTP), by J. Postel and J. Reynolds
# Changes and improvements suggested by Steve Majewski
# Changes and improvements suggested by Steve Majewski
# Modified by Jack to work on the mac.
# Example:
# Example:
...
@@ -220,11 +221,15 @@ class FTP:
...
@@ -220,11 +221,15 @@ class FTP:
if
not
user
:
user
=
'anonymous'
if
not
user
:
user
=
'anonymous'
if
user
==
'anonymous'
and
passwd
in
(
''
,
'-'
):
if
user
==
'anonymous'
and
passwd
in
(
''
,
'-'
):
thishost
=
socket
.
gethostname
()
thishost
=
socket
.
gethostname
()
if
os
.
environ
.
has_key
(
'LOGNAME'
):
try
:
realuser
=
os
.
environ
[
'LOGNAME'
]
if
os
.
environ
.
has_key
(
'LOGNAME'
):
elif
os
.
environ
.
has_key
(
'USER'
):
realuser
=
os
.
environ
[
'LOGNAME'
]
realuser
=
os
.
environ
[
'USER'
]
elif
os
.
environ
.
has_key
(
'USER'
):
else
:
realuser
=
os
.
environ
[
'USER'
]
else
:
realuser
=
'anonymous'
except
AttributeError
:
# Not all systems have os.environ....
realuser
=
'anonymous'
realuser
=
'anonymous'
passwd
=
passwd
+
realuser
+
'@'
+
thishost
passwd
=
passwd
+
realuser
+
'@'
+
thishost
resp
=
self
.
sendcmd
(
'USER '
+
user
)
resp
=
self
.
sendcmd
(
'USER '
+
user
)
...
...
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