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
37f50e0c
Kaydet (Commit)
37f50e0c
authored
Tem 23, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
üst
f1062762
8966759b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
plistlib.py
Lib/plistlib.py
+3
-5
test_plistlib.py
Lib/test/test_plistlib.py
+5
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/plistlib.py
Dosyayı görüntüle @
37f50e0c
...
@@ -984,18 +984,16 @@ def load(fp, *, fmt=None, use_builtin_types=True, dict_type=dict):
...
@@ -984,18 +984,16 @@ def load(fp, *, fmt=None, use_builtin_types=True, dict_type=dict):
fp
.
seek
(
0
)
fp
.
seek
(
0
)
for
info
in
_FORMATS
.
values
():
for
info
in
_FORMATS
.
values
():
if
info
[
'detect'
](
header
):
if
info
[
'detect'
](
header
):
p
=
info
[
'parser'
](
P
=
info
[
'parser'
]
use_builtin_types
=
use_builtin_types
,
dict_type
=
dict_type
,
)
break
break
else
:
else
:
raise
InvalidFileException
()
raise
InvalidFileException
()
else
:
else
:
p
=
_FORMATS
[
fmt
][
'parser'
](
use_builtin_types
=
use_builtin_types
)
P
=
_FORMATS
[
fmt
][
'parser'
]
p
=
P
(
use_builtin_types
=
use_builtin_types
,
dict_type
=
dict_type
)
return
p
.
parse
(
fp
)
return
p
.
parse
(
fp
)
...
...
Lib/test/test_plistlib.py
Dosyayı görüntüle @
37f50e0c
...
@@ -207,6 +207,9 @@ class TestPlistlib(unittest.TestCase):
...
@@ -207,6 +207,9 @@ class TestPlistlib(unittest.TestCase):
for
fmt
in
ALL_FORMATS
:
for
fmt
in
ALL_FORMATS
:
with
self
.
subTest
(
fmt
=
fmt
):
with
self
.
subTest
(
fmt
=
fmt
):
pl
=
self
.
_create
(
fmt
=
fmt
)
pl
=
self
.
_create
(
fmt
=
fmt
)
pl2
=
plistlib
.
loads
(
TESTDATA
[
fmt
],
fmt
=
fmt
)
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
),
"generated data was not identical to Apple's output"
)
pl2
=
plistlib
.
loads
(
TESTDATA
[
fmt
])
pl2
=
plistlib
.
loads
(
TESTDATA
[
fmt
])
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
),
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
),
"generated data was not identical to Apple's output"
)
"generated data was not identical to Apple's output"
)
...
@@ -217,6 +220,8 @@ class TestPlistlib(unittest.TestCase):
...
@@ -217,6 +220,8 @@ class TestPlistlib(unittest.TestCase):
b
=
BytesIO
()
b
=
BytesIO
()
pl
=
self
.
_create
(
fmt
=
fmt
)
pl
=
self
.
_create
(
fmt
=
fmt
)
plistlib
.
dump
(
pl
,
b
,
fmt
=
fmt
)
plistlib
.
dump
(
pl
,
b
,
fmt
=
fmt
)
pl2
=
plistlib
.
load
(
BytesIO
(
b
.
getvalue
()),
fmt
=
fmt
)
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
))
pl2
=
plistlib
.
load
(
BytesIO
(
b
.
getvalue
()))
pl2
=
plistlib
.
load
(
BytesIO
(
b
.
getvalue
()))
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
))
self
.
assertEqual
(
dict
(
pl
),
dict
(
pl2
))
...
...
Misc/NEWS
Dosyayı görüntüle @
37f50e0c
...
@@ -108,6 +108,9 @@ Core and Builtins
...
@@ -108,6 +108,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #21888: plistlib'
s
load
()
and
loads
()
now
work
if
the
fmt
parameter
is
specified
.
-
Issue
#
22032
:
__qualname__
instead
of
__name__
is
now
always
used
to
format
-
Issue
#
22032
:
__qualname__
instead
of
__name__
is
now
always
used
to
format
fully
qualified
class
names
of
Python
implemented
classes
.
fully
qualified
class
names
of
Python
implemented
classes
.
...
...
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