Stack Exchange Network
Stack Exchange network consists of 182 Q&A communities including
Stack Overflow
, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this community
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Using
ArcPy
in PyCharm, I'm constantly getting
Process finished with exit code -1073741819 (0xC0000005)
in my
RegionGroup
loop. I have posted my code in a previous question (
Process finished with exit code -1073741819 (0xC0000005) from RegionGroup (ArcGIS 10.7)
).
Here I want to know if there is a general possibility to catch a system exit like this (by transforming it into a "real" python error maybe), skip the current iteration and start the next.
I've looked at
Catching a system exit with GDAL Python
but this seemed to have been due to a GDAL-related bug.
EDIT:
I've tried catching the error using
try
and
except
, but so far that has not worked.
regionGrp = RegionGroup(sinks)
# or to avoid saving in a tmp file with potential access violations:
region_save = "C:/.../regionGrp{}.tif".format(glacierID)
RegionGroup(sinks).save(region_save)
except:
print "== strange system exit caught =="
break
The result in the terminal (if the loop breaks) is:
Connecting regions
Compacting labels
Process finished with exit code -1073741819 (0xC0000005)
Normally it should go on like this:
Connecting regions
Compacting labels
Building Attributes
Updating link item
Maybe the error cannot be caught because it happens in the middle of this multi-step RegionGroup algorithm? I'm fairly new to python so I'm not sure if this could be a possibility.
–
–
–
–
Using at Try:/Except: statement in your function should allow you to catch the exception and write out some info about what is going on.
ESRI has some good documentation on this as well.
–
–
–
–
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.