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
1dcf4f9e
Kaydet (Commit)
1dcf4f9e
authored
Mar 25, 2016
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue#26616:Fixed a bug in datetime.astimezone() method.
üst
84ca9fe1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
datetimetester.py
Lib/test/datetimetester.py
+8
-0
NEWS
Misc/NEWS
+2
-0
_datetimemodule.c
Modules/_datetimemodule.c
+6
-1
No files found.
Lib/test/datetimetester.py
Dosyayı görüntüle @
1dcf4f9e
...
@@ -3426,6 +3426,14 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
...
@@ -3426,6 +3426,14 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
self
.
assertEqual
(
dt
,
local
)
self
.
assertEqual
(
dt
,
local
)
self
.
assertEqual
(
local
.
strftime
(
"
%
z
%
Z"
),
"-0400 EDT"
)
self
.
assertEqual
(
local
.
strftime
(
"
%
z
%
Z"
),
"-0400 EDT"
)
@support.run_with_tz
(
'EST+05EDT,M3.2.0,M11.1.0'
)
def
test_astimezone_default_near_fold
(
self
):
# Issue #26616.
u
=
datetime
(
2015
,
11
,
1
,
5
,
tzinfo
=
timezone
.
utc
)
t
=
u
.
astimezone
()
s
=
t
.
astimezone
()
self
.
assertEqual
(
t
.
tzinfo
,
s
.
tzinfo
)
def
test_aware_subtract
(
self
):
def
test_aware_subtract
(
self
):
cls
=
self
.
theclass
cls
=
self
.
theclass
...
...
Misc/NEWS
Dosyayı görüntüle @
1dcf4f9e
...
@@ -94,6 +94,8 @@ Core and Builtins
...
@@ -94,6 +94,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #26616: Fixed a bug in datetime.astimezone() method.
- Issue #21925: :func:`warnings.formatwarning` now catches exceptions on
- Issue #21925: :func:`warnings.formatwarning` now catches exceptions on
``linecache.getline(...)`` to be able to log :exc:`ResourceWarning` emitted
``linecache.getline(...)`` to be able to log :exc:`ResourceWarning` emitted
late during the Python shutdown process.
late during the Python shutdown process.
...
...
Modules/_datetimemodule.c
Dosyayı görüntüle @
1dcf4f9e
...
@@ -4749,7 +4749,12 @@ local_timezone(PyDateTime_DateTime *utc_time)
...
@@ -4749,7 +4749,12 @@ local_timezone(PyDateTime_DateTime *utc_time)
PyObject
*
nameo
=
NULL
;
PyObject
*
nameo
=
NULL
;
const
char
*
zone
=
NULL
;
const
char
*
zone
=
NULL
;
delta
=
datetime_subtract
((
PyObject
*
)
utc_time
,
PyDateTime_Epoch
);
delta
=
new_delta
(
ymd_to_ord
(
GET_YEAR
(
utc_time
),
GET_MONTH
(
utc_time
),
GET_DAY
(
utc_time
))
-
719163
,
60
*
(
60
*
DATE_GET_HOUR
(
utc_time
)
+
DATE_GET_MINUTE
(
utc_time
))
+
DATE_GET_SECOND
(
utc_time
),
0
,
0
);
if
(
delta
==
NULL
)
if
(
delta
==
NULL
)
return
NULL
;
return
NULL
;
one_second
=
new_delta
(
0
,
1
,
0
,
0
);
one_second
=
new_delta
(
0
,
1
,
0
,
0
);
...
...
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