Debugging with ArcPy breakpoints after Point to Line

1045
6
03-15-2019 12:17 PM
RichardHughes2
Occasional Contributor III

Hello,

I've been developing with python for several years and don't recall having this issue before.  When I set breakpoints at the PointsToLine_management function call, the debugger stops.  When I click run, it continues all the way through the script without stopping on any other breakpoints.  

I am able to step through the arcpy function line by line, but stepping out or over does not return me to my script and hit the next breakpoint.

It seems that the debugger context is not getting set back after returning from the arcpy function call.

I am using Visual Studio Code so that could be the source of the problem.  Is anyone also using VS Code to write/debug python?

Thanks!

Tags (2)
0 Kudos
6 Replies
ChristianBehnken
New Contributor

Same problem here. I´m using PyCharm so it seems the problem is related to the PointsToLine_management function. As a workaround, I started PointsToLine_management through multiprocessing module in a new process, and after this separate process has finished, the debugger hits the next breakpoint as expected.

0 Kudos
MKF62
by
Occasional Contributor III

Do you have an example of using the multiprocessing module that you can share? 

0 Kudos
MKF62
by
Occasional Contributor III

Problem still exists in 2020. Using Visual Studio Enterprise to code in python. Any call to ExcelToTable or TableToExcel makes all breakpoints afterward non-functional. If I comment out those lines, the breakpoints will work again.

0 Kudos
DanPatterson
MVP Esteemed Contributor

Points to line is a script not a tool, which is why I suspect that your break points fail

hammer, versus scroll


... sort of retired...
0 Kudos
RichardHughes2
Occasional Contributor III

Hi Dan,

Could you describe why using a script tool vs toolbox tool would not work?  Do you think it is because of what is going on inside the script tool rather than just that it is a script tool?  I was thinking this type of issue is related to multiprocessing task bug within Esri tools, but that could be wrong.

Thanks!

0 Kudos
DanPatterson
MVP Esteemed Contributor

Richard Hughes‌ I just looked at the difference in the tools.  The this was the only difference I could see on short examination.

You could experiment to see if this happens with standalone scripts I suppose, or try one of the other scripts in ArcToolbox like Add Geometry Attributes, XY table to Points, etc (witin the Data Management, Features Toolset)


... sort of retired...
0 Kudos