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
94ad49fa
Kaydet (Commit)
94ad49fa
authored
Nis 08, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26709: Fixed Y2038 problem in loading binary PLists.
üst
152a19c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
plistlib.py
Lib/plistlib.py
+1
-1
test_plistlib.py
Lib/test/test_plistlib.py
+9
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/plistlib.py
Dosyayı görüntüle @
94ad49fa
...
...
@@ -685,7 +685,7 @@ class _BinaryPlistParser:
f
=
struct
.
unpack
(
'>d'
,
self
.
_fp
.
read
(
8
))[
0
]
# timestamp 0 of binary plists corresponds to 1/1/2001
# (year of Mac OS X 10.0), instead of 1/1/1970.
return
datetime
.
datetime
.
utcfromtimestamp
(
f
+
(
31
*
365
+
8
)
*
86400
)
return
datetime
.
datetime
(
2001
,
1
,
1
)
+
datetime
.
timedelta
(
seconds
=
f
)
elif
tokenH
==
0x40
:
# data
s
=
self
.
_get_size
(
tokenL
)
...
...
Lib/test/test_plistlib.py
Dosyayı görüntüle @
94ad49fa
...
...
@@ -428,6 +428,15 @@ class TestPlistlib(unittest.TestCase):
b
'
\x00\x00\x00\x00\x00\x00\x00\x13
'
)
self
.
assertEqual
(
plistlib
.
loads
(
data
),
{
'a'
:
'b'
})
def
test_large_timestamp
(
self
):
# Issue #26709: 32-bit timestamp out of range
for
ts
in
-
2
**
31
-
1
,
2
**
31
:
with
self
.
subTest
(
ts
=
ts
):
d
=
(
datetime
.
datetime
.
utcfromtimestamp
(
0
)
+
datetime
.
timedelta
(
seconds
=
ts
))
data
=
plistlib
.
dumps
(
d
,
fmt
=
plistlib
.
FMT_BINARY
)
self
.
assertEqual
(
plistlib
.
loads
(
data
),
d
)
class
TestPlistlibDeprecated
(
unittest
.
TestCase
):
def
test_io_deprecated
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
94ad49fa
...
...
@@ -99,6 +99,8 @@ Core and Builtins
Library
-------
- Issue #26709: Fixed Y2038 problem in loading binary PLists.
- Issue #23735: Handle terminal resizing with Readline 6.3+ by installing our
own SIGWINCH handler. Patch by Eric Price.
...
...
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