You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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 acceptPathlib
object but just plain string. This means that commands like thiswill 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?
The text was updated successfully, but these errors were encountered: