IOError: MapDocObject: Unable to save. Check to make sure you have write access

06-07-2018 04:53 AM
Occasional Contributor III

Hello everyone,

I am running a very simple program to change datasources in a mxd layers in ArcMap 10.4.1.

I have write access to the folder.

Source Code:

# Parent directory to MXDs.  Script will iterate through Child directories
arcpy.env.workspace  = r"C:\Workspace\NB\Oracle"

# New Enterprise Geodatabase

newDataSource = r"C:\GISData_SQL.sde"

arcpy.env.overwriteOutput = True

for (path, dirs, files) in os.walk(arcpy.env.workspace):
    for file in files:
        print file
        if ".mxd" in file.lower():
            mxdfile = os.path.join(path, file)
            print(mxdfile + " is being processed")
            mxd = arcpy.mapping.MapDocument(mxdfile)
         **************************  ERROR WHEN SAVING

Error message:

Traceback (most recent call last):
  File "C:\Workspace\MigrationArcSDEOracleToSQL104\Projects\Change SDE Data", line 53, in <module>
  File "C:\Program Files\ArcGIS\Server\ArcPy\arcpy\", line 182, in fn_
    return fn(*args, **kw)
  File "C:\Program Files\ArcGIS\Server\ArcPy\arcpy\", line 850, in save
    return convertArcObjectToPythonObject(*gp_fixargs((), True)))
IOError: MapDocObject: Unable to save.  Check to make sure you have write access to the specified file and that there is enough space on the storage device to hold your document.

0 Replies