Skip to content

Trouble opening sas file with UNC path #135

Answered by ofajardo
lucielerolland asked this question in Q&A
Discussion options

You must be logged in to vote

hmm, maybe try using forward slashes? https://stackoverflow.com/questions/7169845/using-python-how-can-i-access-a-shared-folder-on-windows-network

otherwise, does this sequence of commands reproduce the issue?

my_unc_path = r'\\server_name\path\to\my\file.sas7dbat'
filename_bytes = os.fsencode(my_unc_path)
filename_bytes = os.path.expanduser(filename_bytes)
os.path.isfile(filename_bytes)

the last line should rise an error, you could print what is filename_bytes to see why os.path.isfile thinks it is not a file.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@ofajardo
Comment options

@ofajardo
Comment options

@ofajardo
Comment options

Answer selected by lucielerolland
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants