Serhiy Storchaka added the comment:
This issue looks as enhancement rather than bug fix. Since it is fixed in 3.6
I'm closing it.
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
type: -> enhancement
___
Python tracker
Serhiy Storchaka added the comment:
Python 3.6:
Traceback (most recent call last):
File "", line 1, in
File "/home/serhiy/py/cpython/Lib/copy.py", line 97, in copy
rv = reductor(4)
TypeError: can't pickle module objects
--
nosy: +serhiy.storchaka
__
R. David Murray added the comment:
Well, we don't generally complicate the code to handle edge cases. That said,
it might not be too complicated to add copy protocol methods to the module
object which just raise a more useful error.
--
nosy: +r.david.murray
__
New submission from mrjbq7:
If you have a simple module (say "foo.py"):
$ cat foo.py
bar = 1
You get weird errors when trying to deep copy them (which I did by accident,
not intentionally trying to deep copy modules):
Python 2.7.2:
>>> import foo
>>> import copy
>>> copy.deepcopy(foo)
Traceb