Wednesday 15 June 2011

python - IOError: [Errno 13] -


I am trying to download a link and install it in the download folder, though I get a permission error. I am an admin user on computer and I also ran in administrator mode. I still get the same error.

Here's the code I do:

  urllib.urlretrieve (link, "C: \ user \% s \ Downloads"% (URL))   

Here is the error:

  traceback (most recent call final): file "c: \ user \ grant \ desktop \ ftb server updater \ ftb updater_v1 .0.py ", line 28, & lt; Module & gt; GetNewServer (Link) File "C: \ User \ Grant \ Desktop \ FTB Server Updater \ FTB Updater_v1.0.py", line 22, I getNewServer urllib.urlretrieve (links, r "c: \ user \% s download" file "C: \ Python27 \ lib \ urllib.py", line 94, urlretrieve return to _urlopener.retrieve (url, file name, report, data) in the file "C: \ Python27 \ lib \ urllib.py", in line 244 Retrieve tfp = open (file name, 'wb') IOError: [Error 13] Permission denied: 'C: \\ user \\ grants \\ download'    

should not urllib.urlretrieve (link, r" C: \ Users \% s \ Downloads "% (user)) ho urllib.urlretrieve (Link, r "c: \ user \% s \ downloads \ SAVE_FILE_NAME"% (user)) ? You are trying to overwrite the download directory, which I'm not sure that Windows will allow. If you have permission, then it can be possible in Unix, but Windows can stop you from doing so!

No comments:

Post a Comment