Select to view content in your preferred language

Python script never terminates

4341
14
08-28-2015 04:40 PM
RobertStevens
Frequent Contributor

Can someone divine why the attached python script never terminates?

I am running with ArcGIS10.3.1 basic.

When I run this using 32-bit python it gets to the last layer

and the terminates with a segmentation violation.

With a 64-bit python it never terminates.

The program runs fine on other maps I have, but

one in particular gives this problem. AFAIK

the map in question is not in any relevant

sense different from those on which the

script runs ok.

Tags (2)
0 Kudos
14 Replies
JoshuaBixby
MVP Esteemed Contributor

Try adding some print statements to see what layer causes the code to hang.  If you change the order of the problem layer, does the code still hang on that layer?

RobertStevens
Frequent Contributor

I had already added some print, but I should have reported what I found.

The script does indeed go through all the layers (there is only

one frame in the map in question) and then hangs at the end

(To be more precise: the 64 bit version of python hangs at

the end; the 32 bit version experiences a segmentation violation).

I tried changing the order of layers. The script always reports

all the layers. Same behavior.

The map in question has many layers, but most of them

are basemap layers which display at different scales.

But the others maps I have are no different in that respect.

I can see nothing special about this map.

All the maps I have use the same basemap layers

but only this particular one (I believe) exhibits this

behavior.

To repeat: I have run Map Doctor and Defragger.

No change.

RebeccaStrauch__GISP
MVP Emeritus

Robert, not that it will fix you issue, but if you want to look at my solution to fixing broken links, I've posted my first version of Python addin for data inventory and “broken-link” repair.   It's definitely a different approach than your code, but I'd be curious if you have a similar issue on you mxd.  If so, than maybe it would point to the mxd and not your script.

0 Kudos
RobertStevens
Frequent Contributor

Rebecca

I today ran your script, the one that identifies broken sources,

and it ran without any problem.

So there does appear to be something wrong with my Python Code.

I am hard pressed to figure out what.

I have many maps, in structure they are very much the same,

but only one causes this problem.

I will compare my code with yours.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

​Robert, mine tests for all (or most anyway) of the anomalies. Seems like different data types, and TOC-groups, etc. need to be tested differently.....even more so when repairing the broken links.  I wouldn't say mine is perfect yet, and I know it could be more efficient, but I'm at the point I need to move on, at least for a while.  I'm hoping others give the broken link reporting a try and give feedback.  I only have my datasets/mxds to test.  So feel free to give scripting feedback....whether I merge it all in or not... .?  I wrote it for our users of course, but hoping it can help others.

0 Kudos