Although the example says the methods can be used without explicitly passing server_name user and password after making the first op, listdir still requires it. Below there is the two examples (I ran a mkdir op before on both cases but left out as its not part of the issue).
Works:
from smbclient import listdir, register_session
register_session("192.168.1.1", username="admin", password="password")
for filename in listdir("192.168.1.1/shared"):
print(filename)
Doesn't:
from smbclient import listdir, register_session
register_session("192.168.1.1", username="admin", password="password")
for filename in listdir("shared"):
print(filename)
>>> ValueError: The SMB path specified must contain the server and share to connect to
I wonder if thats intentional as the valueerror suggests, but at documentation its not really clear.
Although the example says the methods can be used without explicitly passing server_name user and password after making the first op,
listdir
still requires it. Below there is the two examples (I ran a mkdir op before on both cases but left out as its not part of the issue).Works:
Doesn't:
I wonder if thats intentional as the valueerror suggests, but at documentation its not really clear.