Skip to content

Exception thrown when a new version of atbswp is started with an old config file #107

@g0tmk

Description

@g0tmk

Checklist

  • I use the latest release of atbswp
  • The issue is not existing yet

Verbose log

Traceback (most recent call last):
  File "/usr/lib/python3.9/configparser.py", line 789, in get
    value = d[option]
  File "/usr/lib/python3.9/collections/__init__.py", line 941, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/lib/python3.9/collections/__init__.py", line 933, in __missing__
    raise KeyError(key)
KeyError: 'mouse speed'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/g0tmk/repos/atbswp/atbswp/control.py", line 328, in action
    self.mouse_sensibility = settings.CONFIG.getint("DEFAULT", "Mouse Speed")
  File "/usr/lib/python3.9/configparser.py", line 818, in getint
    return self._get_conv(section, option, int, raw=raw, vars=vars,
  File "/usr/lib/python3.9/configparser.py", line 808, in _get_conv
    return self._get(section, conv, option, raw=raw, vars=vars,
  File "/usr/lib/python3.9/configparser.py", line 803, in _get
    return conv(self.get(section, option, **kwargs))
  File "/usr/lib/python3.9/configparser.py", line 792, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'mouse speed' in section: 'DEFAULT'

Miscellaneous information

Operating System

Debian 12

Desktop Environment/Window Manager

Xmonad

Python version

Python 3.9.2

Description

I found an edge case bug, likely only seen by users who update atbswp and have an old version of the config file. After updating, as soon as I clicked the record button the above exception was thrown.

Rough steps to reproduce:

  1. Install an old version of atbswp (before "mouse speed" config value was added)
  2. Run the program so it creates a config file
  3. Update to a new version of atbswp (after "mouse speed" config value was added)
  4. Run the program
  5. Click "record"
  6. Exception is thrown

A workaround is to follow the steps above, but at step 5, click "preferences->mouse recording speed->OK" which will recreate the config file with the new format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions