diff -r 4c2f3240ad65 Lib/ctypes/__init__.py --- a/Lib/ctypes/__init__.py Thu Jul 17 00:00:26 2014 +0300 +++ b/Lib/ctypes/__init__.py Fri Jul 18 23:40:36 2014 +0300 @@ -353,7 +353,7 @@ self._handle = handle def __repr__(self): - return "<%s '%s', handle %x at %x>" % \ + return "<%s '%s', handle %x at %#x>" % \ (self.__class__.__name__, self._name, (self._handle & (_sys.maxsize*2 + 1)), id(self) & (_sys.maxsize*2 + 1)) diff -r 4c2f3240ad65 Lib/reprlib.py --- a/Lib/reprlib.py Thu Jul 17 00:00:26 2014 +0300 +++ b/Lib/reprlib.py Fri Jul 18 23:40:36 2014 +0300 @@ -136,7 +136,7 @@ # Bugs in x.__repr__() can cause arbitrary # exceptions -- then make up something except Exception: - return '<%s instance at %x>' % (x.__class__.__name__, id(x)) + return '<%s instance at %#x>' % (x.__class__.__name__, id(x)) if len(s) > self.maxother: i = max(0, (self.maxother-3)//2) j = max(0, self.maxother-3-i) diff -r 4c2f3240ad65 Lib/test/test_reprlib.py --- a/Lib/test/test_reprlib.py Thu Jul 17 00:00:26 2014 +0300 +++ b/Lib/test/test_reprlib.py Fri Jul 18 23:40:36 2014 +0300 @@ -123,7 +123,7 @@ eq(r(i2), expected) i3 = ClassWithFailingRepr() - eq(r(i3), (""%id(i3))) + eq(r(i3), (""%id(i3))) s = r(ClassWithFailingRepr) self.assertTrue(s.startswith("') + + def test_make_weak_keyed_dict_repr(self): + dict = weakref.WeakKeyDictionary() + self.assertRegex(repr(dict), '') + from test import mapping_tests class WeakValueDictionaryTestCase(mapping_tests.BasicTestMappingProtocol): diff -r 4c2f3240ad65 Lib/test/test_xmlrpc.py --- a/Lib/test/test_xmlrpc.py Thu Jul 17 00:00:26 2014 +0300 +++ b/Lib/test/test_xmlrpc.py Fri Jul 18 23:40:36 2014 +0300 @@ -287,7 +287,7 @@ def test_repr(self): d = datetime.datetime(2007,1,2,3,4,5) t = xmlrpclib.DateTime(d) - val ="" % id(t) + val ="" % id(t) self.assertEqual(repr(t), val) def test_decode(self): diff -r 4c2f3240ad65 Lib/weakref.py --- a/Lib/weakref.py Thu Jul 17 00:00:26 2014 +0300 +++ b/Lib/weakref.py Fri Jul 18 23:40:36 2014 +0300 @@ -144,7 +144,7 @@ return o is not None def __repr__(self): - return "" % id(self) + return "" % id(self) def __setitem__(self, key, value): if self._pending_removals: @@ -348,7 +348,7 @@ return len(self.data) - len(self._pending_removals) def __repr__(self): - return "" % id(self) + return "" % id(self) def __setitem__(self, key, value): self.data[ref(key, self._remove)] = value diff -r 4c2f3240ad65 Lib/xmlrpc/client.py --- a/Lib/xmlrpc/client.py Thu Jul 17 00:00:26 2014 +0300 +++ b/Lib/xmlrpc/client.py Fri Jul 18 23:40:36 2014 +0300 @@ -354,7 +354,7 @@ return self.value def __repr__(self): - return "" % (self.value, id(self)) + return "" % (self.value, id(self)) def decode(self, data): self.value = str(data).strip() @@ -846,7 +846,7 @@ self.__call_list = [] def __repr__(self): - return "" % id(self) + return "" % id(self) __str__ = __repr__