I have written a python code to upload file in sharepoint from local machine directory. It is working fine in local machine. When i try to upload any file from C drive directly of virtual machine to sharepoint, i am facing below error. But sharepoint is getting opened in virtual machine with my credentials. Can you let me know it is an operating system issue or as virtual machine has many users, there is some security concern.
from sharepoint import SharePointSite, basic_auth_opener
import subprocess
import shutil
server_url = "https://abc.sharepoint.com/"
site_url = server_url + "sites/Report/"
opener = basic_auth_opener(server_url, "email ID", "Password")
site = SharePointSite(site_url, opener)
subprocess.call(r'net use Y: https://abc.sharepoint.com/sites/Report/')
shutil.copy(r"C:/log.txt","Y:\\",follow_symlinks=True)

error is as under: File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 121, in copyfile with open(dst, ‘wb’) as fdst:
FileNotFoundError: [Errno 2] No such file or directory: ‘Y:’