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 over 1 year ago. Updated about 1 year ago.

Status:Closed 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:

Associated revisions

Revision 3570:48534b8ba9bf
Added by Martin Cooper about 1 year ago

Don't die if GTK Mac integration is missing

If GTK Mac integration is missing, Chirp dies when it tries to log this
fact. The code is designed to handle the absence of this capability and
simply omit the Mac-specific features, so handle the logging gracefully
and carry on.

Fixes #8845


Updated by Bernhard Hailer over 1 year 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!

Updated by Lynda Leung over 1 year ago

I too have this issue on one of my Macs. Using patch resolved the startup issue.
I've also tested this patch with the machine didn't have the startup issue, and it too ran fine.
Only thing I can think of is that I do have brew python 2.7.17 on one that had the issue, and 2.7.15 on the one that didnt have an issue. But I thought the unified package has it's own self contained environment?

Please merge this patch with the main branch for future releases, thanks.

Updated by Anonymous about 1 year ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

Applied in changeset 48534b8ba9bf.

Also available in: Atom PDF