niklas24

error with mxd.save/mxd.SaveACopy

Discussion created by niklas24 on Apr 9, 2012
Latest reply on May 27, 2015 by jquist1
I'm trying to use arcpy to save an .mxd and am having an issue. It doesn't matter if I use mxd.save or mxd.saveACopy I get the same error. I know it doesn't look like I am doing anything w/ it here, but it's just a portion of my code that I've pulled out into a separate script to test:

import arcpy
import arcpy.mapping as map

mxd = map.MapDocument(r"C:\MGIS\Finalproject2.mxd")
mxd.saveACopy(mxd)


I get the following error:

Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\MGIS\geog485\FinalProject2\mxdtest.py", line 7, in <module>
    mxd.saveACopy(mxd)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\utils.py", line 181, in fn_
    return fn(*args, **kw)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\_mapping.py", line 668, in saveACopy
    self._arc_object.saveACopy(file_name)
AttributeError: 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.


Space is not the issue, I have 60 GB of free space and I've checked the windows properties of the .mxd file. Read-only box is unchecked and I've "allowed" all permissions for all groups:

[ATTACH=CONFIG]13339[/ATTACH]

Does anyone have any idea how if this is a bug or how I can fix this?  It's probably user error but is really holding me up. I'm using PythonWin 2.6 ArcInfo 10.0 SP4.

Thanks in advance.

Attachments

Outcomes