Ticket #77 (assigned Defect: null)
Setting the geoprocessor's OverwriteOutput property from a Python script does not seem to work
| Reported by: | jjr8 | Owned by: | jjr8 |
|---|---|---|---|
| Priority: | Medium | Milestone: | Unscheduled |
| Component: | Core - ArcGIS Interop | Version: | 0.2 |
| Keywords: | Cc: |
Description
In the script below, if the files in inputFiles has already been copied to outputFiles, the script will fail with an error indicating that a destination file already exists. This is not supposed to happen because the geoprocessor's OverwriteOutput? environment variable is supposed to be used by FileFindAndCopy?_GeoEco to determine whether files should be overwritten.
from win32com.client import Dispatch
gp = Dispatch('esriGeoprocessing.GPDispatch')
gp.AddToolbox('c:\\Python25\\lib\\site-packages\\GeoEco\\ArcGISToolbox\\Marine
print(str(gp.OverwriteOutput))
gp.OverwriteOutput = True
print(str(gp.OverwriteOutput))
gp.FileFindAndCopy_GeoEco('c:\\temp8\\inputFiles', 'c:\\temp8\\outputFiles')
The print statements show that the OverwriteOutput? environment variable is being set. But enabling debug logging reveals that FileFindAndCopy?_GeoEco apparently is not seeing the True value:
2007-06-19 14:28:41,415 DEBUG ArcGIS Geoprocessor object 0x00EB0E90: Get OverwriteOutput returned False 2007-06-19 14:28:41,415 DEBUG Parameter overwriteExisting = False
At first glance, this looks like a bug in Arc 9.1.
Change History
Note: See
TracTickets for help on using
tickets.
