Closed s-light closed 4 months ago
Hello Stefan,
Thank you for taking the time to report the bug and providing the details. I appreciate your feedback.
How do you installed BIT? From Ubuntus official repo?
I am not sure but it seems you installed keyring from PyPi. It might be that it shadows the keyring package installed from the official Ubuntu repos. Please check pip list | grep -i keyring
.
If there is one please uninstall it via pip uninstall keyring
.
Best regards,
you are correct - i did install via offical ubuntu package.. (or at least i think so .... its about a year ago..)
and indeed there is keyring installed via pip...
$ pip list | grep -i keyring
WARNING: Skipping /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/EGG-INFO due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib/python3.12/dist-packages/argcomplete-3.1.4.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib/python3.12/dist-packages/charset_normalizer-3.3.2.dist-info due to invalid metadata entry 'name'
keyring 24.3.1
but if i try to deinstall:
pip uninstall keyring
WARNING: Skipping /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/EGG-INFO due to invalid metadata entry 'name'
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
i get the wounderfull magic warning :-)
so i did searched a bit more..
pipx list
venvs are in /home/stefan/.local/pipx/venvs
apps are exposed on your $PATH at /home/stefan/.local/bin
manual pages are exposed at /home/stefan/.local/share/man
package circup 2.0.1, installed using Python 3.12.3
- circup
package cookiecutter 2.3.0, installed using Python 3.11.4
- cookiecutter
package esptool 4.6.2, installed using Python 3.11.2
- esp_rfc2217_server.py
- espefuse.py
- espsecure.py
- esptool.py
package jedi-language-server 0.41.1, installed using Python 3.11.4
- jedi-language-server
package keyring 25.2.1, installed using Python 3.12.3
- keyring (symlink missing or pointing to unexpected location)
package pre-commit 3.3.3, installed using Python 3.11.4
- pre-commit
package sphinx 7.2.4, installed using Python 3.11.4
- sphinx-apidoc
- sphinx-autogen
- sphinx-build
- sphinx-quickstart
and uninstalled it via pipx
$ pipx uninstall keyring
uninstalled keyring! ✨ 🌟 ✨
and with this i got
$ backintime-qt --debug
DEBUG: [common/backintime.py:589 argParse] Arguments: {'debug': True} | unknownArgs: []
Back In Time
Version: 1.4.3
Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.
DEBUG: [common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Main profile
DEBUG: [common/tools.py:186 initiate_translation] No language code. Use systems current locale.
DEBUG: [common/backintime.py:677 getConfig] config file: /home/stefan/.config/backintime/config
DEBUG: [common/backintime.py:678 getConfig] share path: /home/stefan/.local/share/backintime
DEBUG: [common/backintime.py:679 getConfig] profiles: 1=Main profile
DEBUG: [common/pluginmanager.py:245 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:249 PluginManager.load] Probing plugin usercallbackplugin.py
DEBUG: [common/pluginmanager.py:249 PluginManager.load] Probing plugin systrayiconplugin.py
DEBUG: [common/tools.py:735 is_Qt5_working] Qt5 probing result: exit code 2
DEBUG: [common/tools.py:738 is_Qt5_working] Qt5 probing stdout:
DEBUG: [common/tools.py:739 is_Qt5_working] Qt5 probing errout:
DEBUG: [common/qt5_probing.py:89 <module>] /usr/share/backintime/common/qt5_probing.py started... Call args: ['/usr/share/backintime/common/qt5_probing.py', '--debug']
DEBUG: [common/qt5_probing.py:90 <module>] Display system: x11
DEBUG: [common/qt5_probing.py:91 <module>] XDG_RUNTIME_DIR=/run/user/1000
DEBUG: [common/qt5_probing.py:92 <module>] XAUTHORITY=/tmp/xauth_RvDmNg
DEBUG: [common/qt5_probing.py:93 <module>] QT_QPA_PLATFORM=($QT_QPA_PLATFORM is not set)
DEBUG: [common/qt5_probing.py:95 <module>] Current euid: 1000
QSettings::value: Empty key passed
QSettings::value: Empty key passed
DEBUG: [common/qt5_probing.py:126 <module>] isSystemTrayAvailable for Qt5: True
DEBUG: [common/qt5_probing.py:131 <module>] /usr/share/backintime/common/qt5_probing.py is terminating normally (exit code: 2)
DEBUG: [plugins/systrayiconplugin.py:76 init] System tray is available to show the BiT system tray icon
DEBUG: [common/pluginmanager.py:263 PluginManager.load] Add plugin systrayiconplugin.py
DEBUG: [common/pluginmanager.py:249 PluginManager.load] Probing plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:263 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [qt/qttools.py:229 createQApplication] QT QPA platform plugin: xcb
DEBUG: [qt/qttools.py:230 createQApplication] QT_QPA_PLATFORMTHEME=<not set>
DEBUG: [qt/qttools.py:235 createQApplication] QT_STYLE_OVERRIDE=<not set>
DEBUG: [qt/qttools.py:238 createQApplication] QT active style: breeze
DEBUG: [qt/qttools.py:239 createQApplication] QT fallback style: breeze
DEBUG: [qt/qttools.py:240 createQApplication] QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
DEBUG: [qt/qttools.py:241 createQApplication] themeSearchPaths: ['/home/stefan/.local/share/icons', '/var/lib/flatpak/exports/share/icons', '/usr/share/icons', '/var/lib/snapd/desktop/icons', ':/icons']
DEBUG: [qt/qttools.py:242 createQApplication] fallbackSearchPaths: []
DEBUG: [qt/qttools.py:247 createQApplication] Is SystemTray available: True
DEBUG: [qt/qttools.py:264 createQApplication] Trying to set App ID for non-privileged user
DEBUG: [qt/qttools.py:304 initiate_translator] No language code. Use systems current locale.
DEBUG: [qt/icon.py:20 <module>] Checking if the current theme contains the BiT icon...
DEBUG: [qt/icon.py:32 <module>] Found an installed theme: breeze-dark
DEBUG: [common/tools.py:1143 keyringSupported] Keyring config file folder: /home/stefan/.config/python_keyring
Traceback (most recent call last):
File "/usr/share/backintime/common/tools.py", line 1153, in keyringSupported
displayName = keyring.get_keyring().__module__
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/core.py", line 33, in get_keyring
init_backend()
File "/usr/lib/python3/dist-packages/keyring/core.py", line 84, in init_backend
set_keyring(_detect_backend(limit))
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/core.py", line 102, in _detect_backend
filter(limit, backend.get_all_keyring()), # type: ignore # 659
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/util/__init__.py", line 22, in wrapper
func.always_returns = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 222, in get_all_keyring
_load_plugins()
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 206, in _load_plugins
for ep in metadata.entry_points(group='keyring.backends'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 913, in entry_points
return EntryPoints(eps).select(**params)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 910, in <genexpr>
eps = itertools.chain.from_iterable(
^
File "/usr/lib/python3.12/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 835, in _normalized_name
or super()._normalized_name
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 462, in _normalized_name
return Prepared.normalize(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 762, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/re/__init__.py", line 186, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/backintime/qt/app.py", line 2006, in <module>
mainWindow = MainWindow(cfg, appInstance, qapp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/backintime/qt/app.py", line 356, in __init__
mnt = mount.Mount(cfg=self.config,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/backintime/common/mount.py", line 157, in __init__
cache = password.Password_Cache(self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/backintime/common/password.py", line 58, in __init__
self.keyringSupported = tools.keyringSupported()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/backintime/common/tools.py", line 1155, in keyringSupported
displayName = str(keyring.get_keyring()) # technical class name!
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/core.py", line 33, in get_keyring
init_backend()
File "/usr/lib/python3/dist-packages/keyring/core.py", line 84, in init_backend
set_keyring(_detect_backend(limit))
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/core.py", line 102, in _detect_backend
filter(limit, backend.get_all_keyring()), # type: ignore # 659
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/util/__init__.py", line 22, in wrapper
func.always_returns = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 222, in get_all_keyring
_load_plugins()
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 206, in _load_plugins
for ep in metadata.entry_points(group='keyring.backends'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 913, in entry_points
return EntryPoints(eps).select(**params)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 910, in <genexpr>
eps = itertools.chain.from_iterable(
^
File "/usr/lib/python3.12/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 835, in _normalized_name
or super()._normalized_name
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 462, in _normalized_name
return Prepared.normalize(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 762, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/re/__init__.py", line 186, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
so no change.. but i will do a restart and see if maybe this helps..
restart did not fix it.
the pip version is listed again. and if i do
$ pip show keyring
WARNING: Skipping /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/EGG-INFO due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib/python3.12/dist-packages/argcomplete-3.1.4.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib/python3.12/dist-packages/charset_normalizer-3.3.2.dist-info due to invalid metadata entry 'name'
Name: keyring
Version: 24.3.1
Summary: Store and access your passwords safely.
Home-page: https://github.com/jaraco/keyring
Author: Kang Zhang
Author-email: jobo.zh@gmail.com
License:
Location: /usr/lib/python3/dist-packages
Requires: jaraco.classes, jeepney, SecretStorage
Required-by:
i would think that this is the official distribution package listed here - i have one installed (as requirement from some other package...)
$ apt list *keyring*
Listing... Done
...
gnome-keyring-pkcs11/noble,now 46.1-2build1 amd64 [installed,automatic]
gnome-keyring/noble,now 46.1-2build1 amd64 [installed,automatic]
...
kitware-archive-keyring/now 2023.06.23 all [installed,local]
...
libpam-gnome-keyring/noble,now 46.1-2build1 amd64 [installed,automatic]
...
python3-keyring/noble,noble,now 24.3.1-1 all [installed,automatic]
...
ubuntu-keyring/noble,noble,now 2023.11.28.1 all [installed,automatic]
...
i currently have no idea how to track this down any futher -
maybe deinstall bit and then try to narrow it down...
Can you reproduce the error without BIT using this line?
python3 -c "import keyring;print(keyring.get_keyring())"
apt bit uninstall did not removed the python3-keyring package.
$ python3 -c "import keyring;print(keyring.get_keyring())"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/keyring/core.py", line 33, in get_keyring
init_backend()
File "/usr/lib/python3/dist-packages/keyring/core.py", line 84, in init_backend
set_keyring(_detect_backend(limit))
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/core.py", line 102, in _detect_backend
filter(limit, backend.get_all_keyring()), # type: ignore # 659
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/util/__init__.py", line 22, in wrapper
func.always_returns = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 222, in get_all_keyring
_load_plugins()
File "/usr/lib/python3/dist-packages/keyring/backend.py", line 206, in _load_plugins
for ep in metadata.entry_points(group='keyring.backends'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 913, in entry_points
return EntryPoints(eps).select(**params)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 910, in <genexpr>
eps = itertools.chain.from_iterable(
^
File "/usr/lib/python3.12/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 835, in _normalized_name
or super()._normalized_name
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 462, in _normalized_name
return Prepared.normalize(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 762, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/re/__init__.py", line 186, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
so yeah - the error is not BIT specific!
thanks buhtz for your time!!!
i think i have to move this to the python-keyring repository...
Report the problem to the original/upstream keyring author please.
Also remove your pip-version of this package via pip uninstall keyring
. Then BIT again will use the package from Debian repo installed via apt install python3-keyring
.
thanks! i will post the issue there.
just for the completeness:
$ pip uninstall keyring
WARNING: Skipping /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/EGG-INFO due to invalid metadata entry 'name'
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
stefan@stefan-Zen:~$
stefan@stefan-Zen:~$ pip uninstall keyring --break-system-packages
WARNING: Skipping /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/EGG-INFO due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/EGG-INFO due to invalid metadata entry 'name'
Found existing installation: keyring 24.3.1
ERROR: Cannot uninstall keyring 24.3.1, RECORD file not found. Hint: The package was installed by debian.
so this package is the debian one..
whatever did the trick i do not know - i thikn it has to do with the shown warning about ptxconf maybe...
thinks i did:
sudo rm -drf /usr/local/lib/python3.12/dist-packages/ptxconf-0.1.0-py3.12.egg/
(i manually experimented with ptxconf installation things some time agopipx reinstall-all
at least - it is now working again!
bit fails to start with a
TypeError: expected string or bytes-like object, got 'NoneType'
seems it can somehow not really access the keyring..in the past (i think before i upgraded my system) it just worked ;-)
console command
backintime-qt --debug
:seems this error is thrown by something at https://github.com/bit-team/backintime/blob/ba50bf9c197a5469abfa53fd017dc15bf8a113b6/common/tools.py#L1281
os
on more reading i found the keyring-config thing and with this found that the problem is the keyring library itself:
so maybe its better to report it there.... (please let me know!)