Bug #8845

Error in exception handling stops OSX version to start if there is an error with loading the GTK libs.

Added by Uwe Winter about 1 month ago. Updated about 1 month ago.

Status:Feedback Start date:02/28/2021
Priority:Normal Due date:
Assignee:- % Done:


Target version:chirp-daily
Chirp Version:daily Platform:MacOS
Model affected:(All models)


For some reason CHIRP daily build was not able to load the GTK libraries as a result macapp is not initialised, causing a bug in chirp/chirp/ui/mainapp.py:

Uwes-MacBook-Pro-5340:MacOS uwe$ ./chirp 
2021-02-28 18:53:21.045 CHIRP[10254:39824] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 
WARNING: Icon  not found
Traceback (most recent call last):
  File "./../Resources/chirp/chirpw", line 132, in <module>
    a = mainapp.ChirpMain()
  File "/Users/uwe/Downloads/CHIRP-2.app/Contents/Resources/chirp/chirp/ui/mainapp.py", line 2266, in __init__
  File "/Users/uwe/Downloads/CHIRP-2.app/Contents/Resources/chirp/chirp/ui/mainapp.py", line 2208, in _init_macos
    LOG.error("No MacOS support: %s" % e)
NameError: global name 'e' is not defined

The following patch resolves the e not defined issue:

--- Contents/Resources/chirp/chirp/ui/mainapp_old.py    2021-02-28 19:40:50.000000000 +1100
+++ Contents/Resources/chirp/chirp/ui/mainapp.py    2021-02-28 19:40:00.000000000 +1100
@@ -2193,14 +2193,14 @@
             import gtk_osxapplication
             macapp = gtk_osxapplication.OSXApplication()
-        except ImportError:
+        except ImportError as e:

         # for gtk-mac-integration >= 2.0.7
             import gtkosx_application
             macapp = gtkosx_application.Application()
-        except ImportError:
+        except ImportError as e:

         if macapp is None:


Updated by Bernhard Hailer about 1 month ago

  • Status changed from New to Feedback

Hi Uwe, you may want to discuss this on the developers mailing list. Please read the wiki article Developers. Thanks!

Also available in: Atom PDF