[Python] Why does opening file throw PermissionError, but copying and then opening works

Discussão em 'Python' iniciado por Stack, Fevereiro 13, 2025.

  1. Stack

    Stack Membro Participativo

    I have a file, that is in a cloud (it could be another company computer) and need to open it. When I try to open it via with open(path) as file it throws PermissionError: [Errno 13] Permission denied:.
    Copying via shutil.copyfile does not work either.
    However when I use os.system("copy ...input, output...") I can copy and open the file.

    Can someone tell me, why this is? It works now, but this still bugs me out.

    Continue reading...

Compartilhe esta Página