I am having trouble retrieving the correct path to the current map layer dataSource path. I am using ArcGIS Desktop 10.2 (10.2.0.3348)
The workspace path that gets returned is correct apart from the current users name is not used but replaced by the owner of the Geodatabase Server. Which does not exist on the users machine and so returns empty dictionary on commands like arcpy.da.ListSubtypes(lyr.dataSource).
mxd = arcpy.mapping.MapDocument('CURRENT') df = arcpy.mapping.ListDataFrames(mxd) for lyr in arcpy.mapping.ListLayers(mxd, '*.Couplings'): print lyr.dataSource
What I expected would be;
The user owner is the owner of the Geodatabase Server as listed in the Properties->Administration tab.
I have tried setting the default environment settings in ArcMap & ArcCatalog. Plus setting the arcpy.env.workspace to the correct path.
What am I doing wrong? Obviously I could easily use string replace to correct this but would prefer if there is a better approach.