jeremyephron / simplegmail

A simple Gmail API client for applications in Python
MIT License
336 stars 73 forks source link

Permission Error with filepath= #103

Open carlosace3 opened 10 months ago

carlosace3 commented 10 months ago

Great stuff! works great but I have a problem:

Trying to save att to an specific filepath but it appear to not have the correct permission, opened my script as admin but it does not work:

`messages = gmail.get_messages(query=construct_query(query_params))

for message in messages: if message.attachments: for attm in message.attachments: print("File: " + attm.filename) attm.save(filepath="files", overwrite=True) ` Traceback (most recent call last): attm.save(filepath="files", overwrite=True) with open(filepath, 'wb') as f: ^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: 'files'