Open
Description
I created a client to upload some documents on a SMB share.
As I created and tested the script under Linux I never thought of converting all the path explicit references to something not OS-dependent.
Unfortunately, I now have people running the script on Windows.
I managed to change all path references in my script using Pathlib
so that they will work regardless of the system. However, as far as I understand, pysmb
does not accept Pathlib
object but just plain string. This means that commands like this
conn.storeFile(share_folder, folder + '/' + filename, localFile)
will fail over Windows as the SMB folder will have a different representation.
So...is there a way to re-use the same code on Windows and Linux to access a SMB share without having to write 2 different versions?
Metadata
Assignees
Labels
No labels
Activity