-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Gtk-WARNING when device name contains "markup" #2429
Comments
Ugh, looks like we can't trust the name we get from BlueZ. I suspect the error is from here.
We probably need to escape here blueman/blueman/plugins/applet/RecentConns.py Line 171 in 42110d9
|
Can you try below debugging (and possible fix) patch. It logs the the device name (alias) to the applet log so there may be something interesting in diff --git a/blueman/plugins/applet/RecentConns.py b/blueman/plugins/applet/RecentConns.py
index 84ec37a07..28e825da5 100644
--- a/blueman/plugins/applet/RecentConns.py
+++ b/blueman/plugins/applet/RecentConns.py
@@ -1,5 +1,6 @@
from gettext import gettext as _
from operator import itemgetter
+import html
import time
import logging
from typing import List, TYPE_CHECKING, Optional, Callable, cast, Union
@@ -167,8 +168,10 @@ class RecentConns(AppletPlugin, PowerStateListener):
self.parent.Plugins.DBusService.connect_service(item["device"], item["uuid"], reply, err)
def _build_menu_item(self, item: "Item") -> "SubmenuItemDict":
+ logging.debug(f"{item['name']} - {item['alias']}")
+ alias = html.escape(item["alias"])
mitem: "SubmenuItemDict" = {
- "text": _("%(service)s on %(device)s") % {"service": item["name"], "device": item["alias"]},
+ "text": _("%(service)s on %(device)s") % {"service": item["name"], "device": alias},
"markup": True,
"icon_name": item["mitem"]["icon_name"] if item["mitem"] is not None else item["icon"],
"sensitive": item["device"] is not None, |
@infirit Yes that fixes it! |
For example in the StatusNotifier. fixes blueman-project#2429
For example in the StatusNotifierItem. fixes blueman-project#2429
For example in the StatusNotifierItem. fixes blueman-project#2429
For example in the StatusNotifierItem. fixes #2429
blueman: 2.4.2
BlueZ: 5.77
Distribution: Arch Linux
Desktop environment: awesome wm, notification daemon dunst
My headset, Creative Zen Hybrid Pro, reports a weird name. As an example this reporter says their device name is "ZenHybridPro (SX:A0l9g7[m[`)"; mine is "ZenHybridPro (SX:p<>v......)". (I'm not sure whether this name can be linked to MAC or whatever, allow me to mask part of it). And blueman-applet frequently logs
The Chinese part means "audio and input profile". This is shown 3 times at applet startup, and also several times when device connects. I tried
--loglevel debug
but no relevant logs for this one.The text was updated successfully, but these errors were encountered: