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
55329f8f
Kaydet (Commit)
55329f8f
authored
Kas 17, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19634: time.strftime("%y") now raises a ValueError on AIX when given a
year before 1900.
üst
b6e622d1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
test_strftime.py
Lib/test/test_strftime.py
+6
-8
NEWS
Misc/NEWS
+3
-0
timemodule.c
Modules/timemodule.c
+14
-0
No files found.
Lib/test/test_strftime.py
Dosyayı görüntüle @
55329f8f
...
...
@@ -182,15 +182,13 @@ class Y1900Tests(unittest.TestCase):
a date before 1900 is passed with a format string containing "
%
y"
"""
@unittest.skipUnless
(
sys
.
platform
==
"win32"
,
"Only applies to Windows"
)
def
test_y_before_1900_win
(
self
):
def
test_y_before_1900
(
self
):
t
=
(
1899
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
)
if
sys
.
platform
==
"win32"
or
sys
.
platform
.
startswith
(
"aix"
):
with
self
.
assertRaises
(
ValueError
):
time
.
strftime
(
"
%
y"
,
(
1899
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
))
@unittest.skipIf
(
sys
.
platform
==
"win32"
,
"Doesn't apply on Windows"
)
def
test_y_before_1900_nonwin
(
self
):
self
.
assertEqual
(
time
.
strftime
(
"
%
y"
,
(
1899
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
)),
"99"
)
time
.
strftime
(
"
%
y"
,
t
)
else
:
self
.
assertEqual
(
time
.
strftime
(
"
%
y"
,
t
),
"99"
)
def
test_y_1900
(
self
):
self
.
assertEqual
(
...
...
Misc/NEWS
Dosyayı görüntüle @
55329f8f
...
...
@@ -50,6 +50,9 @@ Core and Builtins
Library
-------
-
Issue
#
19634
:
time
.
strftime
(
"%y"
)
now
raises
a
ValueError
on
AIX
when
given
a
year
before
1900.
-
Fix
test
.
support
.
bind_port
()
to
not
cause
an
error
when
Python
was
compiled
on
a
system
with
SO_REUSEPORT
defined
in
the
headers
but
run
on
a
system
with
an
OS
kernel
that
does
not
support
that
reasonably
new
socket
option
.
...
...
Modules/timemodule.c
Dosyayı görüntüle @
55329f8f
...
...
@@ -650,6 +650,20 @@ time_strftime(PyObject *self, PyObject *args)
return
NULL
;
}
}
#elif defined(_AIX)
for
(
outbuf
=
wcschr
(
fmt
,
'%'
);
outbuf
!=
NULL
;
outbuf
=
wcschr
(
outbuf
+
2
,
'%'
))
{
/* Issue #19634: On AIX, wcsftime("y", (1899, 1, 1, 0, 0, 0, 0, 0, 0))
returns "0/" instead of "99" */
if
(
outbuf
[
1
]
==
L'y'
&&
buf
.
tm_year
<
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"format %y requires year >= 1900 on AIX"
);
Py_DECREF
(
format
);
return
NULL
;
}
}
#endif
fmtlen
=
time_strlen
(
fmt
);
...
...
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