I am having the same problem as Kessler. When I run the following program from PythonWin it works fine the first time when the output file does not exist, but fails the second time immediately after despite indicating that overwriting is enabled. It likewise fails from IDLE. This happens after rebooting the machine and without at any stage running ArgGIS (which is 10.1). There are no lock files that I can see. I am running XP SP3 in case that has any relevance.
import arcpy
from arcpy import env
env.workspace = "d:\Temp"
env.overwiteOutput = True
if env.overwiteOutput:
print "Overwriting is set to True" #This line is indented in the script
arcpy.Clip_analysis("parks.shp","zip.shp","parks_clip.shp")
print arcpy.GetMessages()
Overwriting is set to True
Traceback (most recent call last):
File "D:\Temp\my_clip.py", line 7, in <module>
arcpy.Clip_analysis("parks.shp","zip.shp","parks_clip.shp")
File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\analysis.py", line 56, in Clip
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000725: Output Feature Class: Dataset d:\Temp\parks_clip.shp already exists.
Failed to execute (Clip).
I have repeated the experiment with the exact same results on a different machine (also XP SP3) except this time I ran IDLE before running PythonWin in case PythonWin was somehow corrupting things. (Okay, I know I am grasping at straws, but this is really bugging me).
When the script is cut and paste in the Python window in ArcGIS is works fine.
Anyone any ideas? Please.