Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
g0tmk opened this issue May 22, 2024 · 0 comments
Open
2 tasks done

Comments

@g0tmk
Copy link

g0tmk commented May 22, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant