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
1ac42614
Kaydet (Commit)
1ac42614
authored
Şub 21, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19748: On AIX, time.mktime() now raises an OverflowError for year
outsize range [1902; 2037].
üst
24a882bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
test_time.py
Lib/test/test_time.py
+1
-1
NEWS
Misc/NEWS
+10
-0
timemodule.c
Modules/timemodule.c
+11
-0
No files found.
Lib/test/test_time.py
Dosyayı görüntüle @
1ac42614
...
...
@@ -228,7 +228,7 @@ class TimeTestCase(unittest.TestCase):
self
.
assertEqual
(
time
.
ctime
(
t
),
'Sun Sep 16 01:03:52 1973'
)
t
=
time
.
mktime
((
2000
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
-
1
))
self
.
assertEqual
(
time
.
ctime
(
t
),
'Sat Jan 1 00:00:00 2000'
)
for
year
in
[
-
100
,
100
,
1000
,
2000
,
10000
]:
for
year
in
[
-
100
,
100
,
1000
,
2000
,
2050
,
10000
]:
try
:
testval
=
time
.
mktime
((
year
,
1
,
10
)
+
(
0
,)
*
6
)
except
(
ValueError
,
OverflowError
):
...
...
Misc/NEWS
Dosyayı görüntüle @
1ac42614
...
...
@@ -2,6 +2,16 @@
Python
News
+++++++++++
What
's New in Python 3.4.1?
===========================
Library
-------
- Issue #19748: On AIX, time.mktime() now raises an OverflowError for year
outsize range [1902; 2037].
What'
s
New
in
Python
3.4.0
release
candidate
2
?
===============================================
...
...
Modules/timemodule.c
Dosyayı görüntüle @
1ac42614
...
...
@@ -823,7 +823,18 @@ time_mktime(PyObject *self, PyObject *tup)
time_t
tt
;
if
(
!
gettmarg
(
tup
,
&
buf
))
return
NULL
;
#ifdef _AIX
/* year < 1902 or year > 2037 */
if
(
buf
.
tm_year
<
2
||
buf
.
tm_year
>
137
)
{
/* Issue #19748: On AIX, mktime() doesn't report overflow error for
* timestamp < -2^31 or timestamp > 2**31-1. */
PyErr_SetString
(
PyExc_OverflowError
,
"mktime argument out of range"
);
return
NULL
;
}
#else
buf
.
tm_wday
=
-
1
;
/* sentinel; original value ignored */
#endif
tt
=
mktime
(
&
buf
);
/* Return value of -1 does not necessarily mean an error, but tm_wday
* cannot remain set to -1 if mktime succeeded. */
...
...
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