miketeo/pysmb

python3 urllib error - Unable to connect to shared device

sidbab94 opened this issue · 0 comments

import urllib
from smb.SMBHandler import SMBHandler
opener = urllib.request.build_opener(SMBHandler)
fh = opener.open('smb://{user}:{pwd}@{path}'.format(user='xxxx', pwd='xxxx', path=path))

Above is the code snippet I tried to access files from an smb server. I verified all the credentials, as well as the IP address (of the path). However it is showing me the following error:

urllib.error.URLError: <urlopen error smb error: Failed to retrieve xxxxxxxxxxxx : Unable to connect to shared device

Any fixes? Thanks in advance.