From d23caa10cc7cda236bc27c98cc6d650bcd8d371c Mon Sep 17 00:00:00 2001 From: piotr Date: Fri, 22 Mar 2024 00:52:32 +0100 Subject: [PATCH 1/2] try to avoid #7 --- nwg_hello/tools.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nwg_hello/tools.py b/nwg_hello/tools.py index e338d6f..d7eb76d 100644 --- a/nwg_hello/tools.py +++ b/nwg_hello/tools.py @@ -37,13 +37,15 @@ def list_users(log=False): for uname in os.listdir('/home'): try: # ask pam about users - user = subprocess.check_output(['getent', 'passwd', uname]).decode('ascii').strip() - except subprocess.SubprocessError: + user = subprocess.check_output(['getent', 'passwd', uname]).decode('utf-8').strip() + except Exception as e: # skip nonexistent users + eprint(e) continue - user = user.split(':') - if int(user[2]) >= uid_min: - users.append(user[0]) + if user: + user = user.split(':') + if int(user[2]) >= uid_min: + users.append(user[0]) return users From 80ba89fc67567176c26cfc32370bc9b19239641f Mon Sep 17 00:00:00 2001 From: piotr Date: Fri, 22 Mar 2024 00:53:27 +0100 Subject: [PATCH 2/2] bump to 0.1.8 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ca0a8d3..2ac2765 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def read(f_name): setup( name='nwg-hello', - version='0.1.7', + version='0.1.8', description='GTK3-based greeter for greetd', packages=find_packages(), include_package_data=True,