[issue24676] Error in pickle using cProfile

2015-07-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as duplicate of issue9914. -- resolution: -> duplicate status: open -> closed superseder: -> trace/profile conflict with the use of sys.modules[__name__] ___ Python tracker

[issue24676] Error in pickle using cProfile

2015-07-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The same is with profile, pickle and in 3.x. May be profile should set sys.modules['__main__']? -- components: +Library (Lib) -Extension Modules nosy: +georg.brandl, serhiy.storchaka type: crash -> behavior versions: +Python 3.4, Python 3.5, Python 3.

[issue24676] Error in pickle using cProfile

2015-07-20 Thread Erick Fonseca
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. Example code: import cPickle class A(object): pass a = A() with open('file.dat', 'wb') as f: cPickl