Using Windows reserved words ruined my ArcMap and ArcGIS Pro

11-21-2019 05:34 AM
Occasional Contributor

I created an Arcpy script to generate point shapefiles for different watersheds.

I used split by features to create single watersheds. Each watershed has unique 3 letter code and I used that code to split features. I was not able to create single watershed shapefiles but I was able to create feature class in a geodatabase. 

Then, I used these 3 letter codes feature class to create point shapefiles as boundary for each watershed in a loop. I realized when it comes to 'CON' loop stopped. 

import arcpyfrom collections import defaultdict  
= 'C:\\CHIA_Routine\\CHIA_Watersheds.gdb'
smis_wq_resultsXY = geo_db + 'smis_wq_resultsXY'huc12_370 = geo_db + '\\HUC12_370'
with arcpy.da.SearchCursor(huc12_370, ['WatershedD', 'CIAMaster', 'Code3', 'HUC_12']) as cursor:
= 1
for row in cursor:
[row[0]] = [row[1], row[2], row[3], n]
[row[1]] = [row[0], row[2], row[3], n]
= n+1
for watershed in watershed_shp_dic.keys():
= watershed_shp_dic[watershed][1]
= main_folder + '\\' + 'Watershed_DataSets' + '\\' + watershed_shp_dic[watershed][0] + '\\' + code3
= main_folder + '\\' + 'Watershed_DataSets' + '\\' + watershed_shp_dic[watershed][0]
.Clip_analysis(smis_wq_resultsXY, geo_db + '\\' + code3, code3_prefix + '.shp')

I checked if 'CON' reserved word in ArcGIS product but it was not. Finally after three days I figured 'CON' was a Windows reserved word and that was the causing issue. 

Windows doc

However, now my geodatabase system ruined and Split by Attributes tool does not work anymore. It only generates the tables but no geometry. Also, my geodatabases look like folder instead of geodatabase symbol. Both ArcMap and ArcGIS Pro messed up. 

I figured if I do not use these Windows reserved words my code works but I have lost quite some time to find the issue. I need to finish this project as soon as possible. Is there any quick fix for this problem. 

0 Kudos
0 Replies