Select to view content in your preferred language

arcpy Script that used to work now crashes python.exe (change from SP2 to SP3)

968
3
10-25-2011 06:59 AM
RaphaelR
Deactivated User
i just noticed that a python script with an ui that works on every computer running arcgis 10 sp2 completely crashes python on a computer with arcgis 10 sp3 installed.
and i have no clue why?

i extracted the part of the code that crashes:
import os
import arcpy
import tkFileDialog
from tkFileDialog import *

myFormats = [("ESRI Shapefile",'*.shp')]

file = askopenfile(filetypes=myFormats,title="Select Input file...")
inFeatures = str(file.name)
print inFeatures, type(inFeatures)

desc = arcpy.Describe(inFeatures)
if "line" in desc.shapeType:
    
    print "Input Geometry Type: OK - "  + str(desc.shapeType)
else: 
    print "Error: Input has invalid Geometry Type - " + str(desc.shapeType)




any suggestions on how to fix this would be appreciated
Tags (2)
0 Kudos
3 Replies
RaphaelR
Deactivated User
the problem seems to be, that when i select an input through a file dialog(have tried tkinter and pyqt so far) it completely screws up once anything afterwards has got anything to do with arcpy (doesn´t even matter if i use the input from the file dialog).

as mentioned the only change on my system was installing SP3, didn´t have that problem before.

import arcpy
import tkFileDialog
from tkFileDialog import *

myFormats = [("ESRI Shapefile",'*.shp')]

file = askopenfile(filetypes=myFormats,title="Select Input file...")
inFeatures = str(file.name)
print inFeatures

flds= arcpy.ListFields("e:/test/test.shp") #crashes here even though the input file is not used
print flds
0 Kudos
GusMartinka
Frequent Contributor
I saw a similar problem with a python script of mine. It ran on a task scheduler ever night for 2 months. The day I installed SP3 it stopped working no other changes involved. I rolled back to SP2 and the script ran fine again.

My script included lots of arcpy with some connections to an SDE (9.3) database.

I think I will just stick with SP2 for now.

Good Luck.
0 Kudos
RaphaelR
Deactivated User
that´s too bad, guess it´s back to SP2 for me as well then (at least for the time being).
hopefully this will get sorted out.
0 Kudos