<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Invalid MXD filename error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340074#M26694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you post the output from the geoprocessing window?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Mar 2011 05:09:05 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2011-03-16T05:09:05Z</dc:date>
    <item>
      <title>Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340069#M26689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to modify a python script that was provided by Esri in the sample arcpay mapping script tools. I'd like to export a PDF for each MXD selected instead of exporting multiple MXDs to a single PDF. Below is the Esri version and beneath that is my version. I feel like I'm doing everything right, but obviously I'm missing something. Any guidance is greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Author:&amp;nbsp; ESRI
# Date:&amp;nbsp;&amp;nbsp;&amp;nbsp; July 5, 2010
# Version: ArcGIS 10.0
# Purpose: This script will export multiple map document layoutinto a single
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output PDF file. The script is intended to run within a script tool.&amp;nbsp; There are two
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameters:
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) Select Map Documents to Append,
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) Output PDF.
#
#Notes: The order of the MXDs is based on how they are entered.&amp;nbsp; The MXD at the
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; top of the list is first followed by those below it.

import arcpy, os, string

#Read input parameters from script tool
mxdList = string.split(arcpy.GetParameterAsText(0), ";")
outPDFpath = arcpy.GetParameterAsText(1)

#Create a new PDF object to store the results
outputPDF = arcpy.mapping.PDFDocumentCreate(outPDFpath)

#Loop through each MXD in the list, export, create a temporary PDF name,
# and append to final, output PDF
for mxdPath in mxdList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp; PDFPath = mxdPath[:-4] + "_temp.pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, PDFPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp; outputPDF.appendPages(str(PDFPath))


#Save the changes and open the result automatically&amp;nbsp;&amp;nbsp; 
outputPDF.saveAndClose()
os.startfile(outPDFpath)

#Remove variable reference to file
del outputPDF&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#MY CODE
import arcpy, os, sys, string

#overwirte existing PDFs
arcpy.OverWriteOutput = 1

multimxds = string.split(arcpy.GetParameterAsText(0), ";")
outputfolder = arcpy.GetParameterAsText(1)

#set variable for PDF name
#trying to set folder path
folderpath = outputfolder

#export to pdf
#trying to export to pdf using title name and folder parameter
for mxdloop in multimxds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdloop)
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = mxd.title
&amp;nbsp;&amp;nbsp;&amp;nbsp; pdf = folderpath + '\\' + name + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdf, 'PAGE_LAYOUT', 640, 480, 400)

#delete folderpath variable
del folderpath&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 23:17:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340069#M26689</guid>
      <dc:creator>JasonHarshman</dc:creator>
      <dc:date>2011-03-14T23:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340070#M26690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you post the error messages?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 23:23:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340070#M26690</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-03-14T23:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340071#M26691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the error I receive in PythonWin. Attached is a screen shot of the error I receive when running the script as a tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec codeObject in __main__.__dict__&lt;BR /&gt;&amp;nbsp; File "C:\Documents and Settings\Harshman\Desktop\PDF Loop Test\ExportMXDToPDF_LOOP.py", line 16, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdloop)&lt;BR /&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\mixins.py", line 443, in __init__&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(89004, "Invalid MXD filename")&lt;BR /&gt;AssertionError: Invalid MXD filename.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 14:35:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340071#M26691</guid>
      <dc:creator>JasonHarshman</dc:creator>
      <dc:date>2011-03-15T14:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340072#M26692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you put an AddMessage in your loop to see what file it's failing on?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#MY CODE
import arcpy, os, sys, string

#overwirte existing PDFs
arcpy.OverWriteOutput = 1

multimxds = string.split(arcpy.GetParameterAsText(0), ";")
outputfolder = arcpy.GetParameterAsText(1)

#set variable for PDF name
#trying to set folder path
folderpath = outputfolder

#export to pdf
#trying to export to pdf using title name and folder parameter
for mxdloop in multimxds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Opening map document %s" % mxdloop)
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdloop)
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = mxd.title
&amp;nbsp;&amp;nbsp;&amp;nbsp; pdf = folderpath + '\\' + name + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdf, 'PAGE_LAYOUT', 640, 480, 400)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340072#M26692</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-11T16:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340073#M26693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It fails on the first MXD selected in my parameter, but it doesn't seem to matter what MXDs I select or in what order I select the MXDs. It always fails on the first one.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 16:00:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340073#M26693</guid>
      <dc:creator>JasonHarshman</dc:creator>
      <dc:date>2011-03-15T16:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340074#M26694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you post the output from the geoprocessing window?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2011 05:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340074#M26694</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-03-16T05:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340075#M26695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is a screen shot of the GP window. Like I said, it fails on the first MXD in the list. Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2011 15:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340075#M26695</guid>
      <dc:creator>JasonHarshman</dc:creator>
      <dc:date>2011-03-16T15:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340076#M26696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah, I see now. Need to strip the quotes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;multimxds = [filename[1:-1] for filename in string.split(arcpy.GetParameterAsText(0), ";")]&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2011 00:08:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340076#M26696</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-03-17T00:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340077#M26697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure I follow. I stripped the quotes and got an invalid syntax error. I used single quotes and got the same invalid MXD error. I inserted the code snippet you provided and i still received the invalid MXD error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, sys, string

#overwirte existing PDFs
arcpy.OverWriteOutput = 1

multimxds = [filename[1:-1] for filename in string.split(arcpy.GetParameterAsText(0), ";")]
outputfolder = arcpy.GetParameterAsText(1)

#set variable for PDF name
#trying to set folder path
folderpath = outputfolder

#export to pdf
#trying to export to pdf using title name and folder parameter
for mxdloop in multimxds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdloop)
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = mxd.title
&amp;nbsp;&amp;nbsp;&amp;nbsp; pdf = folderpath + '\\' + name + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdf, 'PAGE_LAYOUT', 640, 480, 400)

#delete folderpath variable
del folderpath&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:05:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340077#M26697</guid>
      <dc:creator>JasonHarshman</dc:creator>
      <dc:date>2021-12-11T16:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340078#M26698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is failing because your MXD path has spaces in it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 02:39:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340078#M26698</guid>
      <dc:creator>JuanOrozco</dc:creator>
      <dc:date>2011-10-06T02:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340079#M26699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The above code actually does work, even with spaces in the path name. I think something was hung up in memory because the code works fine now and it's exactly the same. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running into the same issue for an expanded version of this script. Basically, the script now exports to PDF a batch of MXDs using either their basename (minus the '.mxd') or the string within the title property. I've restarted my computer just to make sure all memory is cleared yet I still receive the Invalid MXD filename error. The interesting part is that the script will execute when the first IF condition is met, but if won't execute the ELSE condition. When it goes to execute the ELSE condition, it appears that the mxd variable is somehow passing off an invalid filename, but how is that possible if it mxd variable works when the IF condition is met? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os, sys, string

#overwirte existing PDFs
arcpy.OverWriteOutput = 1

multimxds = [filename[1:-1] for filename in string.split(arcpy.GetParameterAsText(0), ";")]
outputFolder = arcpy.GetParameterAsText(1)

#set variable for folder location
folderPath = outputFolder

#export to pdf
for mxdLoop in multimxds:
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdLoop)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #use the mxd name as the pdf name
&amp;nbsp;&amp;nbsp;&amp;nbsp; if mxd.title == "":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #get the name of the mxd
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapName = os.path.basename(mxdLoop)[0:-4]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #create the pdf file path and name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pdfName = folderPath + '\\' + mapName + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #export to pdf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdfName, 'PAGE_LAYOUT', 640, 480, 300)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #use the mxd title property as the pdf name
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #get the title string
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxdTitle = mxd.title
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #create the pdf file path and name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pdfName = folderPath + '\\' + mxdTitle + ".pdf"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #export to pdf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdfName, 'PAGE_LAYOUT', 640, 480, 300)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#delete variables
del folderPath&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340079#M26699</guid>
      <dc:creator>JasonHarshman</dc:creator>
      <dc:date>2021-12-11T16:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid MXD filename error</title>
      <link>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340080#M26700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Jason, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried your first code, and am getting the Invalid MXD name error as well. When I added a print command to multimxds, it showed me that the name had chaged to *.mx, e.g. the letter D is missing from the extension.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that is coming from this bit:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;multimxds = [filename[1:-1]&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Although I am not very experienced with arcpy yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope it helps&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2013 08:23:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-mxd-filename-error/m-p/340080#M26700</guid>
      <dc:creator>HarmenMolenaar</dc:creator>
      <dc:date>2013-03-28T08:23:38Z</dc:date>
    </item>
  </channel>
</rss>

