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 5 months ago. Updated 3 months ago.

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

0%

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

Description

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
test
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__
    self._init_macos(mbar)
  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 @@
         try:
             import gtk_osxapplication
             macapp = gtk_osxapplication.OSXApplication()
-        except ImportError:
+        except ImportError as e:
             pass

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

         if macapp is None:

History

Updated by Bernhard Hailer 5 months 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 3 months 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.

Also available in: Atom PDF