Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Access is Denied (os.remove)

$
0
0
I'm trying to create a DDP export to PDF script that uses the ESRI Example from South Kingstown, RI, and when I run my script I get this error:

Code:

Runtime error
Traceback (most recent call last):
  File "<string>", line 17, in <module>
WindowsError: [Error 5] Access is denied: 'R:\\GIS\\...\\PDF'

I thinks due to this bit of code:
Code:

if multiPage == "true":
    if os.path.exists(outputPDF):
        os.remove(outputPDF)

    #Create new FinalMapBook that results will be appeneded into
    finalMapBook = arcpy.mapping.PDFDocumentCreate(outputPDF)

I have full access to the drive and the folder. I tried my local drive and I get the same error. Any ideas?

Viewing all articles
Browse latest Browse all 2485

Trending Articles