changeset: 101201:41afb83cffac branch: 3.5 parent: 101199:4f5e4155c259 user: Serhiy Storchaka date: Sun May 01 13:36:16 2016 +0300 files: Lib/plistlib.py Lib/test/test_plistlib.py Misc/NEWS description: Issue #26711: Fixed the comparison of plistlib.Data with other types. diff -r 4f5e4155c259 -r 41afb83cffac Lib/plistlib.py --- a/Lib/plistlib.py Sun May 01 13:06:43 2016 +0300 +++ b/Lib/plistlib.py Sun May 01 13:36:16 2016 +0300 @@ -225,10 +225,10 @@ def __eq__(self, other): if isinstance(other, self.__class__): return self.data == other.data - elif isinstance(other, str): + elif isinstance(other, bytes): return self.data == other else: - return id(self) == id(other) + return NotImplemented def __repr__(self): return "%s(%s)" % (self.__class__.__name__, repr(self.data)) diff -r 4f5e4155c259 -r 41afb83cffac Lib/test/test_plistlib.py --- a/Lib/test/test_plistlib.py Sun May 01 13:06:43 2016 +0300 +++ b/Lib/test/test_plistlib.py Sun May 01 13:36:16 2016 +0300 @@ -515,15 +515,15 @@ cur = plistlib.loads(buf) self.assertEqual(cur, out_data) - self.assertNotEqual(cur, in_data) + self.assertEqual(cur, in_data) cur = plistlib.loads(buf, use_builtin_types=False) - self.assertNotEqual(cur, out_data) + self.assertEqual(cur, out_data) self.assertEqual(cur, in_data) with self.assertWarns(DeprecationWarning): cur = plistlib.readPlistFromBytes(buf) - self.assertNotEqual(cur, out_data) + self.assertEqual(cur, out_data) self.assertEqual(cur, in_data) diff -r 4f5e4155c259 -r 41afb83cffac Misc/NEWS --- a/Misc/NEWS Sun May 01 13:06:43 2016 +0300 +++ b/Misc/NEWS Sun May 01 13:36:16 2016 +0300 @@ -107,6 +107,8 @@ Library ------- +- Issue #26711: Fixed the comparison of plistlib.Data with other types. + - Issue #24114: Fix an uninitialized variable in `ctypes.util`. The bug only occurs on SunOS when the ctypes implementation searches