canopy import error for xml

May 8 at 6:05 PM
Sorry, I am quite new in python so may be it is just basics.
I have installed Canopy 1.3.0.1715 and PTVS 2.0.
I created a project from existing code and try to run it in vs2010. However line:
from xml.etree import cElementTree
has given me error from copy() function.
"un(shallow)copyable object of type <type 'Element'>"
The same line in canopy editor or python command line works well.
Could anyone say what is going wrong?
Coordinator
May 8 at 6:30 PM
This is a known issue when debugging standard library is enabled (in Tools -> Options -> Python Tools -> Debugging). If you need this enabled, then you can just continue execution (that exception is actually handled, so it is safe), or you can look at some other workarounds that are detailed in the comments to the bug.

However, standard library debugging should be disabled by default. Can you clarify whether you enabled that option, or not? If the option is disabled but you're seeing the problem, can you describe how you set up PTVS to work with Canopy - did it auto-detect, or did you manually add it as interpreter in Tools -> Options?
May 9 at 11:52 AM
Hi, Pavel.
I have Debugging standard library setting off, I also tried to set all Python 2.7 exceptions off in Debug/Exceptions window.
However execution still stops at this point. It is not critical now since I can continue execution with F5, but would be nice to fix this stuff as a bit annoying.
I first setup Canopy and then PTVS. PTVS has autodetected Canopy python.
Thank you very much for quick response and your help.
Спасибо!
Yaroslav
Coordinator
May 9 at 4:53 PM
It sounds like our logic for detecting whether any given script is a part of the standard library is not quite working right with auto-detected Canopy - likely to do with the complicated layout that they have. I'll see if I can repro this.