zackb11

"findAndReplaceWorkspacePaths" not working

Discussion created by zackb11 on Jun 10, 2011
Latest reply on Jun 10, 2011 by zackb11
I have a Python script that scans a folder for MXDs, then replaces broken workspace paths with correct workspace paths.  The folder of MXDs is quite large, so to make things easier/faster for testing purposes, I've made a copy of one of the MXDs in a subfolder and worked with that instead.  However, my script does not appear to be fixing the workspace paths.

I've tripled checked that I've entered pathnames correctly (for both the broken and correct paths).  I've actually copied and pasted the pathnames, so they have to be working.  And I've copied and pasted those pathnames back into ArcCatalog to be sure they point to actual files.  Nonetheless, the paths in the MXD aren't changing.

I tried with the workspace paths set to relative, but that didn't work either.

The odd thing is, I did a quick test this morning with an MXD and a shapefile at the base of my C: drive (changing the shapefile's path from C:/test to C:/test1) and it worked fine.

Also, when the script reaches the line of code that saves the MXD, the modified date in Windows Explorer updates.  Any help here would be appreciated.  I've attached the code block.

Thanks

-Zack

Attachments

Outcomes