Bug#939499: mate-tweak: Panel configuration produces TypeError due to dock absence
Package: mate-tweak
Version: 16.10.5-1+deb9u1
Severity: normal
Tags: patch
Dear Maintainer,
Running mate-tweak and attempting panel configuration, selecting different
icon sizes, repeatably causes a TypeError in the program. This does not crash
the user interface, however.
File "/usr/bin/mate-tweak", line 912, in combo_fallback
self.additional_tweaks(schema, key, value[1])
File "/usr/bin/mate-tweak", line 904, in additional_tweaks
self.replace_panel_layout(self.base_layout)
File "/usr/bin/mate-tweak", line 748, in replace_panel_layout
self.disable_dock()
File "/usr/bin/mate-tweak", line 497, in disable_dock
self.remove_dock_autostart()
File "/usr/bin/mate-tweak", line 461, in remove_dock_autostart
if os.path.exists(os.path.join(config_dir, 'autostart/') + self.dock + '.desktop'):
TypeError: Can't convert 'NoneType' object to str implicitly
The problem is caused by an absence of any recognised dock, thus self.dock
being None, and thus the error occurs. As far as I can tell, a simple fix that
short-circuits the test is sufficient, and I can provide a trivial patch for
this purpose.
Sorry if this is already fixed, either upstream or in another version of the
package. I was investigating mate-tweak to see if I could get panel icons to
appear since they appear as dark blue rectangles for me, but that is another
problem.
Regards,
Paul
-- System Information:
Debian Release: 9.9
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: mipsel (mips)
Kernel: Linux 3.18.3 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages mate-tweak depends on:
ii compton 0.1~beta2+20150922-1
ii dconf-cli 0.26.0-2+b1
ii gir1.2-gtk-3.0 3.22.11-1
ii gir1.2-notify-0.7 0.7.7-2
ii mate-desktop-common 1.16.2-2
ii mesa-utils 8.3.0-3
ii python-gobject-2 2.28.6-13
ii python3 3.5.3-1
ii python3-gi 3.22.0-2
ii python3-pkg-resources 33.1.1-1
ii python3-psutil 5.0.1-1
ii python3-setproctitle 1.1.10-1
ii x11-xserver-utils 7.7+7+b1
ii zenity 3.22.0-1+b1
Versions of packages mate-tweak recommends:
ii mate-indicator-applet 1.16.0-1
Versions of packages mate-tweak suggests:
pn indicator-application <none>
pn indicator-messages <none>
pn indicator-sounds <none>
pn metacity <none>
pn xcompmgr <none>
-- no debconf information
--- /usr/bin/mate-tweak 2019-09-05 16:48:59.009918490 +0200
+++ /usr/bin/mate-tweak 2019-09-05 16:44:31.597711379 +0200
@@ -458,7 +458,7 @@
# Old versions of MATE Tweak setup an autostart, these should
# be removed.
config_dir = GLib.get_user_config_dir()
- if os.path.exists(os.path.join(config_dir, 'autostart/') + self.dock + '.desktop'):
+ if self.dock and os.path.exists(os.path.join(config_dir, 'autostart/') + self.dock + '.desktop'):
os.remove(os.path.join(config_dir, 'autostart/') + self.dock + '.desktop')
def enable_hud(self):
Reply to: