PermissionError Errno 13 Permission denied

0 votes

This is the code :

def download():
    # get selected line index
    index = films_list.curselection()[0]
    # get the line's text
    selected_text = films_list.get(index)
    directory = filedialog.askdirectory(parent=root, 
                                        title="Choose where to save your movie")
    place_to_save = directory + '/' + selected_text
    print(directory, selected_text, place_to_save)
    with open(place_to_save, 'wb') as file:
        connect.retrbinary('RETR ' + selected_text, file.write)
    tk.messagebox.showwarning('File downloaded', 
                              'Your movie has been successfully downloaded!' 

But when I run this code I am getting this error:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python34\lib\tkinter\__init__.py", line 1538, in __call__
return self.func(*args)
File "C:/Users/Marc/Documents/Programmation/Python/Llamachat/Llamachat/Llamachat.py", line 32, in download
with open(place_to_save, 'wb') as file:
PermissionError: [Errno 13] Permission denied: '/goodbye.txt'

How can I fix this error?

May 14, 2022 in Python by Kichu
• 19,050 points
3,119 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

Permission denied for .pyc file

Did you run the python script as ...READ MORE

answered Feb 7, 2019 in Python by Omkar
• 69,210 points
5,027 views
0 votes
1 answer

ERROR: mysql 1018 (HY000): Can't read dir of '.' (errno: 13)

Hello @kartik, You need to set ownership and ...READ MORE

answered Jun 24, 2020 in Python by Niroj
• 82,880 points
2,167 views
0 votes
1 answer

pandas and Stata 13 files

You can check with the following: Update your ...READ MORE

answered Jul 4, 2019 in Python by SDeb
• 13,300 points
553 views
0 votes
1 answer

gaierror: [Errno 11003] getaddrinfo failed

Hi@akhtar, It most likely means the hostname of ...READ MORE

answered Apr 15, 2020 in Python by MD
• 95,440 points
17,478 views
0 votes
1 answer

Error executing Jupyter command 'notebook': [Errno 2] No such file or directory

Hi@akhtar, I think there is a problem with ...READ MORE

answered Jun 25, 2020 in Python by MD
• 95,440 points
5,029 views
0 votes
1 answer

Crawling after login in Python

You missed a few login data forms, ...READ MORE

answered Sep 7, 2018 in Python by Priyaj
• 58,090 points
1,459 views
0 votes
1 answer

Crawling after login in Python

You missed a few login data forms, ...READ MORE

answered Sep 14, 2018 in Python by Priyaj
• 58,090 points
718 views
0 votes
1 answer

“stub” __objclass__ in a Python class how to implement it?

You want to avoid interfering with this ...READ MORE

answered Sep 27, 2018 in Python by Priyaj
• 58,090 points
1,864 views
+1 vote
1 answer

How is raw_input() and input() in python3.x?

raw_input() was renamed to input() so now input() returns the exact string ...READ MORE

answered Oct 30, 2018 in Python by Priyaj
• 58,090 points
705 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP