'How do I access a protected network directory on Windows?
I am trying to copy files from a network path like this:
//com.example.corp/example/data/test/copy_dir
to my local drive using Python 3.9 on a Windows machine.
The tricky thing is that I had to make an application for directory authorization in my company for this directory (only the last part of the path "copy_dir"). In my file browser I can access the directory without problems, but if I want to copy files from it using PyCharm, the directory is not even found by
os.path.isdir(directory_path).
I tried to mount the path to a network drive (M://) where I was able to read out the directory and find the files I need, but I get a
[WinError 5] Access denied when I try to copy the files to my local directory.
I also tried to os.chmod(file, 0o777) before copying with
shutil.copyfile with similar results.
Is there a way to "authorize" Python to copy the files I need?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
