I have been running into a strange issue with a code I am working on and it only happens when I am working with data formatted like this. This is from a script that uses a Multivalued Parameter. See below:
fc = "'Database Connections\\Prod@GISdb.OSA.sde\\Prod.Water\\Prod.ControlValve';'Database Connections\\Prod@GISdb.OSA.sde\\Prod.Water\\Prod.wFitting';'Database Connections\\Prod@GISdb.OSA.sde\\Prod.Water\\Prod.wHydrant'"
fclist = fc.split(";")
for each in fclist:
fieldnames = [f.name for f in arcpy.ListFields(each)]
print fieldnames
From this I get the error:
Runtime error
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "c:\program files (x86)\arcgis\desktop10.7\arcpy\arcpy\__init__.py", line 1139, in ListFields
return gp.listFields(dataset, wild_card, field_type)
File "c:\program files (x86)\arcgis\desktop10.7\arcpy\arcpy\geoprocessing\_base.py", line 346, in listFields
self._gp.ListFields(*gp_fixargs(args, True)))
IOError: "'Database Connections\Prod@GISdb.OSA.sde\Prod.Water\Prod.ControlValve'" does not exist
I am at a loss with this error as it appears quite often. If anyone has any points how to avoid this error I would be extremely grateful!