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

distutils package is deprecated #1

Open
tripplehelix opened this issue Oct 9, 2022 · 3 comments
Open

distutils package is deprecated #1

tripplehelix opened this issue Oct 9, 2022 · 3 comments

Comments

@tripplehelix
Copy link

tripplehelix commented Oct 9, 2022

Python 3.10.7
Kernel: 5.19.0-2-amd64
OS: Debian GNU/Linux bookworm/sid
WM: Xfwm4
Shell: zsh 5.9

I was really excited for this, when settings is launched:

/usr/bin/night_mode_settings:4: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.util
Traceback (most recent call last):
  File "/usr/bin/night_mode_settings", line 140, in <module>
    settings = SettingsWindow()
  File "/usr/bin/night_mode_settings", line 41, in __init__
    loadUi(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'settings.ui'), self)
  File "/home/tom/.local/lib/python3.10/site-packages/PyQt5/uic/__init__.py", line 238, in loadUi
    return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
  File "/home/tom/.local/lib/python3.10/site-packages/PyQt5/uic/Loader/loader.py", line 66, in loadUi
    return self.parse(filename, resource_suffix)
  File "/home/tom/.local/lib/python3.10/site-packages/PyQt5/uic/uiparser.py", line 1020, in parse
    document = parse(filename)
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1222, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 569, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/settings.ui'

When the daemon is launched:

/usr/bin/night_mode_daemon:6: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.util
night_mode_daemon /home/tom/.config/night-mode.conf gives {} {}
night_mode_daemon config before reload: {} {}
Traceback (most recent call last):
  File "/usr/bin/night_mode_daemon", line 133, in <module>
    reload_config()
  File "/usr/bin/night_mode_daemon", line 55, in reload_config
    night_mode_enabled = distutils.util.strtobool(config['General']['nightModeEnabled'])
  File "/usr/lib/python3/dist-packages/configobj.py", line 554, in __getitem__
    val = dict.__getitem__(self, key)
KeyError: 'General'
@eMPee584
Copy link
Owner

I'm having a look at this.. the deprecation warning is not the problem though, the path to the settings.ui file is.. going to reproduce & fix over the weekend, regards..

@eMPee584
Copy link
Owner

.. does ls -lah /usr/bin/night_mode_* show that these are symlinks into /usr/share/night_mode/?

@eMPee584
Copy link
Owner

ah settings fails to find its UI file and doesn't write an initial configuration and the daemon doesn't cope with that. I should fix that and simplify the directory structure.. for now, you should be able to run from inside the usr/share/night_mode path in this repo which has three files night_mode_daemon, night_mode_settings and settings.ui

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

2 participants