Arcpy unzipping script: ERROR 000714 Error in executing: cmd.exe /C

المشرف العام

Administrator
طاقم الإدارة
I wrote script for unzip archive with GDB.It works locally, i.e from ArcGis Desktop.

But when I publish scrypt as geoprocessing service, it doesn't work - ERROR 000714: Error in script Zip22. Error in executing: cmd.exe /C

Script:

import arcpyimport osimport sysimport tracebackimport zipfileimport reclass LicenseError(Exception): passdef unzip(zipFileName): try: path = os.path.dirname(zipFileName) zip = zipfile.ZipFile(zipFileName, 'r') gdb_name = None for name in zip.namelist(): if '.gdb' in name.lower(): gdb_name = name.replace('/', os.sep) break if not gdb_name: raise Exception('zip file has no gdb') zip.extractall(path) zip.close() return path + os.sep + gdb_name except RuntimeError: zip.close() arcpy.AddWarning(get_ID_message(86133))def get_ID_message(ID): return re.sub("%1|%2", "%s", arcpy.GetIDMessage(ID))if __name__ == '__main__': try: zipFile = arcpy.GetParameterAsText(0) gdb_name = unzip(zipFile) arcpy.SetParameterAsText(1, gdb_name) except: tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] pymsg = "ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + str(sys.exc_type) + ": " + str(sys.exc_value) + "\n" arcpy.AddError(pymsg)Similar script with archiving GDB to zip works fine both locally and at server.

What's wrong in this script?



أكثر...
 
أعلى