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).
e.g.
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd, '*.Couplings'):
print lyr.dataSource
Which returns;
C:\Users\<owner>\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\GWMAP_SQLEXPRESS.gds
What I expected would be;
C:\Users\<user>\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\GWMAP_SQLEXPRESS.gds
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.