I'm cleaning up a 100 GB network disc full of (old) ArcMap projects, some dating back to 2004 (!). I found out that there are .mxd's on that disc that ArcMap can't handle, because it crashes, throwing the error message in this picture
If I want to test such a .mxd on its validity using Arcpy, I use this simple code (that works for valid .mxd's) and run it in IDLE:
import arcpy
mxd=<name>
try:
inp = arcpy.mapping.MapDocument(mxd)
print "OK"
except:
print "error"
Clearly, it won't print "OK" for an invalid .mxd, but strange enough it does not print "error" either, what you would expect. Instead, IDLE only shows this:
=============================== RESTART: Shell ===============================
>>>
Questions:
- Why is this try: except: not working?
- How to find out, using Arcpy, that a .mxd is invalid? So I can find all invalid .mxd's on that 100 GB disc!