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
ea752fbb
Kaydet (Commit)
ea752fbb
authored
Ock 05, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Check for time.struct_time in addition to tuples. Use 3 characters
for zone hours. Fixes #499169.
üst
b0d71d0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
imaplib.py
Lib/imaplib.py
+5
-5
test_imaplib.py
Lib/test/test_imaplib.py
+14
-0
No files found.
Lib/imaplib.py
Dosyayı görüntüle @
ea752fbb
...
...
@@ -1069,12 +1069,12 @@ def Time2Internaldate(date_time):
Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'
"""
dttype
=
type
(
date_time
)
if
dttype
is
type
(
1
)
or
dttype
is
type
(
1.1
):
if
isinstance
(
date_time
,
int
)
or
isinstance
(
date_time
,
float
):
tt
=
time
.
localtime
(
date_time
)
elif
dttype
is
type
(()):
elif
isinstance
(
date_time
,
tuple
)
or
\
isinstance
(
date_time
,
time
.
struct_time
):
tt
=
date_time
elif
dttype
is
type
(
""
):
elif
isinstance
(
date_time
,
str
):
return
date_time
# Assume in correct format
else
:
raise
ValueError
...
...
@@ -1085,7 +1085,7 @@ def Time2Internaldate(date_time):
zone
=
-
time
.
altzone
else
:
zone
=
-
time
.
timezone
return
'"'
+
dt
+
"
%+0
2
d
%02
d"
%
divmod
(
zone
/
60
,
60
)
+
'"'
return
'"'
+
dt
+
"
%+0
3
d
%02
d"
%
divmod
(
zone
/
60
,
60
)
+
'"'
...
...
Lib/test/test_imaplib.py
0 → 100644
Dosyayı görüntüle @
ea752fbb
from
test_support
import
verify
,
verbose
import
imaplib
import
time
# We can check only that it successfully produces a result,
# not the correctness of the result itself, since the result
# depends on the timezone the machine is in.
timevalues
=
[
2000000000
,
2000000000.0
,
time
.
localtime
(
2000000000
),
"18-May-2033 05:33:20 +0200"
]
for
t
in
timevalues
:
imaplib
.
Time2Internaldate
(
t
)
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