Just tested on my XP PC, Python 2.7, SMB share \myshare
os.listdir('\\myshare') # Fails with "WindowsError: [Error 53] The network path was not found"
os.listdir('\\myshare/folder') # Succeeds
I think some of the confusion could be caused by WindowsError showing the repr()
of the path, rather than the actual path -
>>> repr(path)
"'\\myshare'"
>>> str(path)
'\myshare'
If this is a Python 3 & unicode problem, I suggest trying to fix the string first:
path = "\\mysharefolder"
path = bytes(path, "utf-8").decode("unicode_escape")
print os.listdir(path)
(unfortunately I can't test this since I don't have Python 3 installed, but please let me know if it works and I'll edit my answer)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…