[chirp_devel] py3 File Open problem

Declan Rieb
Wed Dec 14 14:57:15 PST 2022


I finally (FINALLY) figured out what my problem was with py3 on macintosh MacOSX. I must have XQuartz running (an X windows application.) Whew!

It looks as if the Yaesu FT2D is at least partially working with GUI (I know it works with the CLI options.) Thanks. I’ll be trying it out RSN.

I can use the menus to get to recent files (File -> Open Recent). But I’ve run into a problem when I ask to open a file (File -> Open…) An error message shows up in my console indicating
>   File "/Users/declan/chirp/chirp/wxui/main.py", line 814, in _menu_open
>     with wx.FileDialog(self, _('Open a file'),
> TypeError: FileDialog(): argument 3 has unexpected type ‘PosixPath’
and no dialog box ensues.

The code in question is 

> 806     def _menu_open(self, event):
>  807         formats = [_('Chirp Image Files') + ' (*.img)|*.img',
>  808                    _('All Files') + ' (*.*)|*.*']
>  809         for name, pattern, readonly in directory.AUX_FORMATS:
>  810             formats.insert(1, '%s %s (%s)|%s' % (
>  811                 name, _('Files'), pattern, pattern))
>  812 
>  813         wildcard = '|'.join(formats)
>  814         with wx.FileDialog(self, _('Open a file'),
>  815                            chirp_platform.get_platform().get_last_dir(),
>  816                            wildcard=wildcard,
>  817                            style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) as fd:
>  818             if fd.ShowModal() == wx.ID_CANCEL:
>  819                 return
>  820             filename = fd.GetPath()
>  821             d = fd.GetDirectory()
>  822             chirp_platform.get_platform().set_last_dir(d)
>  823             CONF.set('last_dir', d, 'state')
>  824             config._CONFIG.save()
>  825             self.open_file(str(filename))



I’ve no clue where or how “PosixPath” shows up in here, so I’m supposing there’s something wrong with Python or chirp that  I’ve caused to get things running. Has anybody any ideas to fix the File Open dialog on MacOS, please?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20221214/a5a5f885/attachment-0001.html 


More information about the chirp_devel mailing list