Ape / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
711 stars 191 forks source link

Error with bash and user without home-directory #72

Open Bissel opened 6 years ago

Bissel commented 6 years ago

If you start the script with an user without a home directory e.g. apache an error occur:

File "/usr/local/lib/python3.5/dist-packages/samsungctl/__main__.py", line 97, in main
    config = _read_config()
File "/usr/local/lib/python3.5/dist-packages/samsungctl/__main__.py", line 31, in _read_config
    directories.append(os.path.join(os.getenv("HOME"), ".config"))
File "/usr/lib/python3.5/posixpath.py", line 89, in join
    genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
    (funcname, s.__class__.__name__)) from None 

A fix is maybe add a argument --noconf and a real fix would be check if the user has a home directory

Ape commented 6 years ago

@Bissel Thanks for reporting this. Does #73 fix it?

Ape commented 6 years ago

Actually, could you also test if #35 alone fixes it, too?

MP-Munich commented 5 months ago

@Ape Thanks for fixing this!

73 works well.

Output with #35 on my Windows 11 23H2 system: Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Temp\samsungctl-master - Copy\samsungctl\__main__.py", line 1, in <module> import appdirs ModuleNotFoundError: No module named 'appdirs'

Could you please merge #73 to master?