You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
This may well not be a PTVS error, but I can't figure out what else it could be.
When executing my Django project from VS from visual studio 15, the command
fromxml.etreeimportcElementTree
throws an exception. This is discussed here: https://pytools.codeplex.com/workitem/2077. Based on the number of upvotes and the related discussion, this seems to be pretty easy to reproduce and not specific to my project. I understand that PTVS can't figure out that the exception is actually caught down the road and signals it to the user. That's ok.
The thing is that
fromxml.etreeimportcElementTree
should not leave in the first place! cElementTree is part of the standard Python distro and it's definitely available in my environment. (I'm on python 2.7)
You will find here a simple bottle project to reproduce. It's just the bottle template, where I added the import commands in the file routes.py.
If the import is called from the global context (line 10 of routes.py), it will throw.
If I delay the import to a later phase, for example moving it inside the function home(), line 15 of routes.py, the import will be successful.
defhome():
"""Renders the home page."""# Loading cElementTree succeeds, if called here.fromxml.etreeimportcElementTree
Would it be possible that PTVS or the VS debugger would interfere with the import process if the cElementtree is imported early when the project is launched?
cElementtree represents a significant performance boost versus it's pure Python sibling, would be nice to be able to use it in a PTVS environment.
The text was updated successfully, but these errors were encountered:
The exception is raised as part of the import. It does not cause the import to fail, because it is also caught as part of the import. PTVS is not really interfering with the process here, it's just (improperly) reporting an exception that normally occurs under the hood. If you tell it to continue running once it has reported it, it should complete the import successfully.
Hi,
This may well not be a PTVS error, but I can't figure out what else it could be.
When executing my Django project from VS from visual studio 15, the command
throws an exception. This is discussed here: https://pytools.codeplex.com/workitem/2077. Based on the number of upvotes and the related discussion, this seems to be pretty easy to reproduce and not specific to my project. I understand that PTVS can't figure out that the exception is actually caught down the road and signals it to the user. That's ok.
The thing is that
should not leave in the first place! cElementTree is part of the standard Python distro and it's definitely available in my environment. (I'm on python 2.7)
You will find here a simple bottle project to reproduce. It's just the bottle template, where I added the import commands in the file routes.py.
If the import is called from the global context (line 10 of routes.py), it will throw.
If I delay the import to a later phase, for example moving it inside the function home(), line 15 of routes.py, the import will be successful.
Would it be possible that PTVS or the VS debugger would interfere with the import process if the cElementtree is imported early when the project is launched?
cElementtree represents a significant performance boost versus it's pure Python sibling, would be nice to be able to use it in a PTVS environment.
The text was updated successfully, but these errors were encountered: