footnote issue fnmatch always converts bytes per latin- ""from pp tools find import find matches [tryfor filepath in find(pattern=filenamepattstartdir=dirname)trytextfile open(filepathencoding=encodingfor (linenumlinestrin enumerate(textfile)if grepkey in linestrmsg '% @% [% ](filepathlinenum linestrmatches append(msgexcept unicodeerror as xprint('unicode error in:'filepathxegdecodebom except ioerror as xprint('io error in:'filepathxegpermission finallymyqueue put(matchesstop consumer loop on find excsfilenamesdef grepthreadconsumer(selfgrepkeyencodingmyqueuemypopup)""in the main gui threadwatch queue for results or []there may be multiple active grep threads/loops/queuesthere may be other types of threads/checkers in processespecially when pyedit is attached component (pymailgui)""import queue trymatches myqueue get(block=falseexcept queue emptymyargs (grepkeyencodingmyqueuemypopupself after( self grepthreadconsumer*myargselsemypopup destroy(close status self update(erase it now if not matchesshowinfo('pyedit''grep found no matches for%rgrepkeyelseself grepmatcheslist(matchesgrepkeyencodingdef grepmatcheslist(selfmatchesgrepkeyencoding)""populate list after successful matcheswe already know unicode encoding from the searchuse it here when filename clickedso open doesn' ask user""from pp gui tour scrolledlist import scrolledlist print('matches for % % (grepkeylen(matches))catch list double-click class scrolledfilenames(scrolledlist)def runcommand(selfselection)fileline selection split(editor texteditormainpopup[' )[ split('@'pyedita text editor program/object