Furkan Onder <furkanon...@protonmail.com> added the comment:
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, >>> ---------- nosy: +furkanonder _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38770> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com