From 5577941f883cd9d86cc35d87a0b3d5a88433265f Mon Sep 17 00:00:00 2001 From: cmccabe Date: Wed, 15 Jan 2020 16:18:28 +0000 Subject: [PATCH] bugfix: crash when linkulatorrc doesn't exist --- config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.py b/config.py index f660f62..1066fb0 100644 --- a/config.py +++ b/config.py @@ -77,6 +77,11 @@ def init(): USER.datadir.mkdir(mode=0o755, exist_ok=True) + if not USER.settingsfile.is_file(): + with open(USER.settingsfile, 'w+') as the_file: + the_file.write("[User Status]\nlastlogin = 0.0\n\n[User Settings]\nbrowser = lynx") + + if not is_readable(USER.datadir.stat().st_mode): print( "Warning: %s is not group or other readable - changing permissions"