Select to view content in your preferred language

Geoprocessing script project data source broken

2742
1
01-19-2014 09:38 PM
JesseAdams
Occasional Contributor
I'm trying to publish a fairly simple Geoprocessing script that will allow a user to extract some points to a zipped shapefile.  When I try to publish this service to ArcServer 10.2.1 it reports that the scratch folder I'm using for the shapefile: "script contains broken project data source."  Here is the code referencing the scratch folder:

outputDir = os.path.join(scriptPath,"ScratchAPD")
if not os.path.exists(outputDir):
    os.mkdir(scriptPath+"\\ScratchAPD")


How can I get this to successfully publish?  Is there a different method of referencing a scratch folder that will be used in a geoprocessing script?  Thank you!
Tags (2)
0 Kudos
1 Reply
GregYetman
Deactivated User
You may want to change the line that creates the output folder to use the existing variable. A colleague told me about issues publishing scripts that include the '\' character. Apparently, the process uses strict checking and looks for any string that may be a path to see if it exists.

So the code would be:

outputDir = os.path.join(scriptPath,"ScratchAPD")
if not os.path.exists(outputDir):
    os.mkdir(outputDir)
0 Kudos