Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
47d1d7f4
Commit
47d1d7f4
authored
May 01, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #26711: Fixed the comparison of plistlib.Data with other types.
parents
b608196b
dd1bcdf6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
Lib/plistlib.py
Lib/plistlib.py
+2
-2
Lib/test/test_plistlib.py
Lib/test/test_plistlib.py
+3
-3
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/plistlib.py
View file @
47d1d7f4
...
@@ -225,10 +225,10 @@ class Data:
...
@@ -225,10 +225,10 @@ class Data:
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
self
.
__class__
):
if
isinstance
(
other
,
self
.
__class__
):
return
self
.
data
==
other
.
data
return
self
.
data
==
other
.
data
elif
isinstance
(
other
,
str
):
elif
isinstance
(
other
,
bytes
):
return
self
.
data
==
other
return
self
.
data
==
other
else
:
else
:
return
id
(
self
)
==
id
(
other
)
return
NotImplemented
def
__repr__
(
self
):
def
__repr__
(
self
):
return
"%s(%s)"
%
(
self
.
__class__
.
__name__
,
repr
(
self
.
data
))
return
"%s(%s)"
%
(
self
.
__class__
.
__name__
,
repr
(
self
.
data
))
...
...
Lib/test/test_plistlib.py
View file @
47d1d7f4
...
@@ -514,15 +514,15 @@ class TestPlistlibDeprecated(unittest.TestCase):
...
@@ -514,15 +514,15 @@ class TestPlistlibDeprecated(unittest.TestCase):
cur
=
plistlib
.
loads
(
buf
)
cur
=
plistlib
.
loads
(
buf
)
self
.
assertEqual
(
cur
,
out_data
)
self
.
assertEqual
(
cur
,
out_data
)
self
.
assert
Not
Equal
(
cur
,
in_data
)
self
.
assertEqual
(
cur
,
in_data
)
cur
=
plistlib
.
loads
(
buf
,
use_builtin_types
=
False
)
cur
=
plistlib
.
loads
(
buf
,
use_builtin_types
=
False
)
self
.
assert
Not
Equal
(
cur
,
out_data
)
self
.
assertEqual
(
cur
,
out_data
)
self
.
assertEqual
(
cur
,
in_data
)
self
.
assertEqual
(
cur
,
in_data
)
with
self
.
assertWarns
(
DeprecationWarning
):
with
self
.
assertWarns
(
DeprecationWarning
):
cur
=
plistlib
.
readPlistFromBytes
(
buf
)
cur
=
plistlib
.
readPlistFromBytes
(
buf
)
self
.
assert
Not
Equal
(
cur
,
out_data
)
self
.
assertEqual
(
cur
,
out_data
)
self
.
assertEqual
(
cur
,
in_data
)
self
.
assertEqual
(
cur
,
in_data
)
...
...
Misc/NEWS
View file @
47d1d7f4
...
@@ -256,6 +256,8 @@ Core and Builtins
...
@@ -256,6 +256,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
26711
:
Fixed
the
comparison
of
plistlib
.
Data
with
other
types
.
-
Issue
#
24114
:
Fix
an
uninitialized
variable
in
`
ctypes
.
util
`.
-
Issue
#
24114
:
Fix
an
uninitialized
variable
in
`
ctypes
.
util
`.
The
bug
only
occurs
on
SunOS
when
the
ctypes
implementation
searches
The
bug
only
occurs
on
SunOS
when
the
ctypes
implementation
searches
...
...
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