Willy-JL / F95Checker

GNU General Public License v3.0
101 stars 16 forks source link

Qt platform error with non-ascii paths #28

Closed essaion closed 4 months ago

essaion commented 1 year ago

I just downloaded and unpacked the latest revision (9.3.1) for Windows, but the application won't start.

A terminal window is opening up, then closing within a few seconds. Launching the .exe from a pre-opened terminal window is showing the same behaviour (the terminal window will close withouth any message getting displayed - or maybe for too short a time so that I cannot read it).

log.txt contains: qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

I suspect this could be caused by an accentuated character within the path. Indeed, as a test I unpacked into its own folder ("F95Checker-Windows") directly into my D:\ and it started like a charm. (FYI, I checked whether space characters within the path are handled correctly: they are indeed. Then I added an accentuated character to the path ('é') - the window of the application would not get displayed anymore).

Willy-JL commented 1 year ago

Good find, but I’m not sure I can do much about it... sounds like a problem with pyqt or even worse qt itself (also more likely since that is written in c++, which is far more picky with weird characters...)

essaion commented 1 year ago

Hmm, weird. I cannot imagine how such a bug could still exist in libraries that are so much used, worldly. Although very unfamiliar with Python, I am tempted to get my nose in your code, just in case. ;) Thanks for your answer though; I'll update here in the very unlikely event I find something.

Willy-JL commented 1 year ago

Now that i think more about it, i think it might be something to do with the prebuilt binary. Since it bootstraps its own stripped down version of python, it might be compiled with lesser support for unicode paths? Just throwing the idea out there, still need to investigate

essaion commented 1 year ago

You might be on something here, indeed. I am afraid my knowledge on the matter is way too thin to be of any help (I just discovered that it is possible to build a .EXE from a Python project ^^'), but what I understand of your guess makes sense nonetheless. Good luck troubleshooting this - if you want to, that is (seems like I am currently the only impacted user, and I found a workaround ;) ).

Willy-JL commented 1 year ago

Can you try build 755?

essaion commented 1 year ago

Just tried that version: it seems to be handling space characters just fine, well done!

As for the accentuated characters, they are still a problem though: the app crashes with the same error message:

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

FWIW, I could see it only when launching F95Checker-Debug.exe, as that message does not appear in log.txt (logging issue?). Running F95Checker.exe results in an error window having title “F95Checker.exe” and content “This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.”

Willy-JL commented 1 year ago

FWIW, I could see it only when launching F95Checker-Debug.exe, as that message does not appear in log.txt (logging issue?). Running F95Checker.exe results in an error window having title “F95Checker.exe” and content “This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.”

Problem is that python is a higher level language built on top of C++, and many of the libraries in use, and in particular Qt, like to do their own logging directly to system level streams, which I have next to no control over. What I do is when the user opens this app, it does very little initialization at first, and just spawns a copy of itself as a child process, so that the parent process has full access to the child process output streams and can handle some crashes a bit more gracefully. However, windows is fucking stupid so there is no easy way to hide the console window consistently. So I just gave up and made 2 executables, one with output streams (-Debug.exe) and one without. The one with console output keeps its console open so yo ucan see everything, while the other has no way to print errors, so it shows a messagebox with just the actual error, no prior program output.

As for the accentuated characters, they are still a problem though: the app crashes with the same error message:

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

bummer... what i had done in that commit is try to zip up the qt files to take up less space, and was hoping that it could help with path issues, looks like it does not. and testing it i found out anyway that zipping it breaks the login window on windows so no zipping on windows anyway... guess this remains a problem...

Willy-JL commented 11 months ago

can you try with one of the latest builds from the actions tab? cx_Freeze was bumped with many improvements to Qt bundling so this might be fixed

r37r05p3C7 commented 4 months ago

Tested latest build on Windows 10 (22H2 19045.3996) with the following characters in path(first 1500 Unicode chars):

!#$%&'()+,-0123456789;=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{}~¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴǵǶǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞȟȠȡȢȣȤȥȦȧȨȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȼȽȾȿɀɁɂɃɄɅɆɇɈɉɊɋɌɍɎɏɐɑɒɓɔɕɖɗɘəɚɛɜɝɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮɯɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿʀʁʂʃʄʅʆʇʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʘʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʼʽʾʿˀˁ˂˃˄˅ˆˇˈˉˊˋˌˍˎˏːˑ˒˓˔˕˖˗˘˙˚˛˜˝˞˟ˠˡˢˣˤ˥˦˧˨˩˪˫ˬ˭ˮ˯˰˱˲˳˴˵˶˷˸˹˺˻˼˽˾˿̴̵̶̷̸̡̢̧̨̛̖̗̘̙̜̝̞̟̠̣̤̥̦̩̪̫̬̭̮̯̰̱̲̳̹̺̻̼͇͈͉͍͎̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̽̾̿̀́͂̓̈́͆͊͋͌̕̚ͅ͏͓͔͕͖͙͚͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ͘͜͟͢͝͞͠͡ͰͱͲͳʹ͵Ͷͷͺͻͼͽ;Ϳ΄΅Ά·ΈΉΊΌΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϡϢϣϤϥϦϧϨϩϪϫϬϭϮϯϰϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿҀҁ҂҃҄҅҆҇҈҉ҊҋҌҍҎҏҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҠҡҢңҤҥҦҧҨҩҪҫҬҭҮүҰұҲҳҴҵҶҷҸҹҺһҼҽҾҿӀӁӂӃӄӅӆӇӈӉӊӋӌӍӎӏӐӑӒӓӔӕӖӗӘәӚӛӜӝӞӟӠӡӢӣӤӥӦӧӨөӪӫӬӭӮӯӰӱӲӳӴӵӶӷӸӹӺӻӼӽӾӿԀԁԂԃԄԅԆԇԈԉԊԋԌԍԎԏԐԑԒԓԔԕԖԗԘԙԚԛԜԝԞԟԠԡԢԣԤԥԦԧԨԩԪԫԬԭԮԯԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖՙ՚՛՜՝՞՟ՠաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆևֈ։֊֍֎֏ְֱֲֳִֵֶַָֹֺֻּֽ֑֖֛֢֣֤֥֦֧֪֚֭֮֒֓֔֕֗֘֙֜֝֞֟֠֡֨֩֫֬֯־ֿ׀ׁׂ׃ׅׄ׆ׇאבגדהוזחטיךכלםמןנסעףפץצקרשתׯװױײ׳״؆؇؈؉؊؋،؍؎؏ؘؙؚؐؑؒؓؔؕؖؗ؛؝؞؟ؠءآأؤإئابةتثجحخدذرزسشصضطظعغػؼؽؾؿـفقكلمنهوىيًٌٍَُِّْٕٖٜٓٔٗ٘ٙٚٛٝ

I also tested other random snippets from printable Unicode character set: chinese, japanese, emojis, etc.

The only characters causing issues are:

  1. Comma (U+002C): throwing qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "".
  2. Semicolon (U+003B): throwing Fatal error: Unable to load python3.dll!

Both probably related to cx_freeze packaging and non critical(maybe worth mentioning in README to avoid them). I believe we can safely conclude that issues #28 and #34 were mostly resolved in the latest build and can be closed.