[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#860523: python-dogtail: /bin/sniff fails to start on a merged-/usr system



Control: tags -1 patch

On Tue, 18 Apr 2017 09:20:58 +0200 intrigeri@debian.org wrote:
> Hi!
> 
> I have usrmerge installed so sniff will be started from /bin/sniff
> by default. It fails like this:
> 
> Traceback (most recent call last):
>   File "/bin/sniff", line 783, in <module>
>     main()
>   File "/bin/sniff", line 780, in main
>     sniff = SniffApp()
>   File "/bin/sniff", line 65, in __init__
>     self.app.set_icon_from_file(os.path.join(path, 'share/icons/hicolor/scalable/apps/dogtail-head.svg'))
> Error: g-file-error-quark: Failed to open file '/share/icons/hicolor/scalable/apps/dogtail-head.svg': No such file or directory (4)
> 
> But starting /usr/bin/sniff explicitly works.
> 
> It looks like sniff is assuming too much wrt. the location of icons
> relatively to the location of the executable.

It seems to me the upstream made an effort to load data from
/usr/share even if the script is in /bin, they just got one
comparison wrong.

I hope you can test that the software still works with my patch
applied, as I don't use dogtail myself.


Cheers,
Juhani
Description: Comparison with is will always fail, use == instead
 Allows the script to be started as /bin/sniff, while the icon
 is located under /usr/share/.
Author: Juhani Numminen <juhaninumminen0@gmail.com>
Bug-Debian: https://bugs.debian.org/860523
Forwarded: no
Last-Update: 2018-09-03

--- a/sniff/sniff
+++ b/sniff/sniff
@@ -60,7 +60,7 @@
             import os
             path = os.path.abspath(
                 os.path.join(__file__, os.path.pardir, os.path.pardir))
-            if path is '/':
+            if path == '/':
                 path = '/usr'
             self.app.set_icon_from_file(os.path.join(path, 'share/icons/hicolor/scalable/apps/dogtail-head.svg'))
         self.setUpWidgets()

Reply to: