I have trouble while using the pathlib. Statement: mypath = pathlib.Path(sys.argv[0]).parent works fine on Windows (Python 3.12.6). On Linux (Debian Bookworm, Python 3.11.2) the same statement triggers the error:
Error:Traceback (most recent call last):
File "/home/lado/programs/wol.py", line 43, in <module>
mypath = pathlib.Path(sys.argv[0]).parent
My first thought was that the package platform was not installed. But when I checked which modules were installed with >>> help('modules'), it turned out that the platform module was installed, so it should be working. I know I can work around it by just parsing the path string 'barefoot', but I would like to understand why this statement is not working on Linux the way it should?!