Python Forum
getting [Errno 13] Permission denied:
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getting [Errno 13] Permission denied:
#1
from azure.storage.blob import BlockBlobService
from azure.storage.blob import PublicAccess
import os

def run_sample():
    try:

        block_blob_service = BlockBlobService(account_name='***',
                                              account_key='***')

        container_name = "test"
        block_blob_service.create_container(container_name)
        print('container created')
        block_blob_service.set_container_acl(container_name, public_access=PublicAccess.Container)
        print('public access provided')
        full = "D:"
        os.chdir(full)
        print(os.getcwd())
        full_na = 'demo1'
        os.chdir(full_na)
        print(os.getcwd())

        print('entered into path')
        files = os.listdir(full)
        for name in files:
            print(name)
            block_blob_service.create_blob_from_path(container_name, files, file_path=os.getcwd())

    except Exception as e:
        print(e)

# Main method.
if __name__ == '__main__':
    run_sample()
Output:
I'm getting this error: container created public access provided D:\ D:\demo1 entered into path stderr [Errno 13] Permission denied: 'D:\\demo1' Process finished with exit code 0
Question
I need to upload the files to azure blob storage from folder demo1 in 'D' Drive
Reply
#2
It's telling you that you don't have access to directory demo1 on D:
or, it's also possible that the directory doesn't exist

**Note** You can make the directory manipulation much cleaner by using pathlib.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  KivyMD android app - problem with permission polak7gt 0 288 Jan-18-2024, 01:27 PM
Last Post: polak7gt
  Potential Permission error on Mac OSX Catalina OWOLLC 1 721 Nov-02-2023, 07:52 AM
Last Post: unjnsacih
  logging: change log file permission with RotatingFileHandler erg 0 1,038 Aug-09-2023, 01:24 PM
Last Post: erg
  The INSERT permission was denied on the object Steven5055 2 1,485 Feb-25-2023, 11:37 PM
Last Post: Steven5055
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,804 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Server Folder Error : WinError5 Access Denied fioranosnake 1 1,125 Jun-21-2022, 11:11 PM
Last Post: Larz60+
  Permission issue when using scapy jao 3 9,819 Feb-05-2022, 06:14 PM
Last Post: snippsat
  Error no 13: Permission denied in python shantanu97 1 6,172 Mar-31-2021, 02:15 PM
Last Post: snippsat
  Access denied not able to do anything 8( What do i do? MurphysLaw 3 3,778 Oct-20-2020, 08:16 AM
Last Post: snippsat
  How a Mac OS software can restart itself with admin permission in Python 3.7? Formationgrowthhacking 0 1,785 Sep-03-2020, 05:29 PM
Last Post: Formationgrowthhacking

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020