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
365ba8f6
Kaydet (Commit)
365ba8f6
authored
Eyl 28, 2015
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes issue #23600: Wrong results from tzinfo.fromutc().
üst
36aff2db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
datetimetester.py
Lib/test/datetimetester.py
+23
-0
NEWS
Misc/NEWS
+3
-0
_datetimemodule.c
Modules/_datetimemodule.c
+1
-1
No files found.
Lib/test/datetimetester.py
Dosyayı görüntüle @
365ba8f6
...
@@ -192,6 +192,29 @@ class TestTZInfo(unittest.TestCase):
...
@@ -192,6 +192,29 @@ class TestTZInfo(unittest.TestCase):
self
.
assertEqual
(
derived
.
utcoffset
(
None
),
offset
)
self
.
assertEqual
(
derived
.
utcoffset
(
None
),
offset
)
self
.
assertEqual
(
derived
.
tzname
(
None
),
oname
)
self
.
assertEqual
(
derived
.
tzname
(
None
),
oname
)
def
test_issue23600
(
self
):
DSTDIFF
=
DSTOFFSET
=
timedelta
(
hours
=
1
)
class
UKSummerTime
(
tzinfo
):
"""Simple time zone which pretends to always be in summer time, since
that's what shows the failure.
"""
def
utcoffset
(
self
,
dt
):
return
DSTOFFSET
def
dst
(
self
,
dt
):
return
DSTDIFF
def
tzname
(
self
,
dt
):
return
'UKSummerTime'
tz
=
UKSummerTime
()
u
=
datetime
(
2014
,
4
,
26
,
12
,
1
,
tzinfo
=
tz
)
t
=
tz
.
fromutc
(
u
)
self
.
assertEqual
(
t
-
t
.
utcoffset
(),
u
)
class
TestTimeZone
(
unittest
.
TestCase
):
class
TestTimeZone
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
365ba8f6
...
@@ -24,6 +24,9 @@ Library
...
@@ -24,6 +24,9 @@ Library
- Issue #25203: Failed readline.set_completer_delims() no longer left the
- Issue #25203: Failed readline.set_completer_delims() no longer left the
module in inconsistent state.
module in inconsistent state.
- Issue #23600: Default implementation of tzinfo.fromutc() was returning
wrong results in some cases.
- Issue #23329: Allow the ssl module to be built with older versions of
- Issue #23329: Allow the ssl module to be built with older versions of
LibreSSL.
LibreSSL.
...
...
Modules/_datetimemodule.c
Dosyayı görüntüle @
365ba8f6
...
@@ -3046,7 +3046,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt)
...
@@ -3046,7 +3046,7 @@ tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt)
goto
Fail
;
goto
Fail
;
if
(
dst
==
Py_None
)
if
(
dst
==
Py_None
)
goto
Inconsistent
;
goto
Inconsistent
;
if
(
delta_bool
(
delta
)
!=
0
)
{
if
(
delta_bool
(
(
PyDateTime_Delta
*
)
dst
)
!=
0
)
{
PyObject
*
temp
=
result
;
PyObject
*
temp
=
result
;
result
=
add_datetime_timedelta
((
PyDateTime_DateTime
*
)
result
,
result
=
add_datetime_timedelta
((
PyDateTime_DateTime
*
)
result
,
(
PyDateTime_Delta
*
)
dst
,
1
);
(
PyDateTime_Delta
*
)
dst
,
1
);
...
...
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