[New-bugs-announce] [issue24676] Error in pickle using cProfile
report at bugs.python.org
Tue Jul 21 00:23:56 CEST 2015
New submission from Erick Fonseca:
cPickle raises a PicklingError when trying to pickle an instance of a class defined in a module being profiled with cProfile.
a = A()
with open('file.dat', 'wb') as f:
Running the above example with python -m cProfile resulted in
cPickle.PicklingError: Can't pickle <class '__main__.A'>: attribute lookup __main__.A failed
I'm not sure if this is the intended behavior (I suppose __main__ in this case refers to the cProfile module file), but I googled it and couldn't find anything. I noticed this problem in Ubuntu 14.04 and Windows 8.1, both with Python 2.7.
components: Extension Modules
nosy: Erick Fonseca
title: Error in pickle using cProfile
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce