This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author furkanonder
Recipients Saim Raza, furkanonder, serhiy.storchaka
Date 2020-04-21.23:19:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587511150.66.0.505514806989.issue38770@roundup.psfhosted.org>
In-reply-to
Content
I ran your script and didn't get RecursionError. The issue seems to be fixed.

Python 3.8.2 (default, Apr  8 2020, 14:31:25) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import print_function
>>> 
>>> import pickle, sys
>>> 
>>> class Foo:
...     __name__ = __qualname__ = "Foo.ref"
...     pass
... 
>>> Foo.ref = Foo
>>> 
>>> print(sys.version_info)
sys.version_info(major=3, minor=8, micro=2, releaselevel='final', serial=0)
>>> for proto in range(0, pickle.HIGHEST_PROTOCOL + 1):
...     print("{}:".format(proto), end=" ")
...     try:
...         pkl = pickle.dumps(Foo, proto)
...         print("Dump OK,", end=" ")
...         assert(pickle.loads(pkl) is Foo)
...         print("Load OK,")
...     except Exception as err:
...         print(repr(err))
... 
0: PicklingError("Can't pickle <class '__main__.Foo.ref'>: import of module '__main__' failed")
1: PicklingError("Can't pickle <class '__main__.Foo.ref'>: import of module '__main__' failed")
2: PicklingError("Can't pickle <class '__main__.Foo.ref'>: import of module '__main__' failed")
3: PicklingError("Can't pickle <class '__main__.Foo.ref'>: import of module '__main__' failed")
4: Dump OK, Load OK,
5: Dump OK, Load OK,
>>>
History
Date User Action Args
2020-04-21 23:19:10furkanondersetrecipients: + furkanonder, serhiy.storchaka, Saim Raza
2020-04-21 23:19:10furkanondersetmessageid: <1587511150.66.0.505514806989.issue38770@roundup.psfhosted.org>
2020-04-21 23:19:10furkanonderlinkissue38770 messages
2020-04-21 23:19:10furkanondercreate