I have come across similar before. You probably have logger set to write to stdout &/or stderr, however, in the compiled application stdout, stderr = None, None hence the errors. The trick that I used was to check if they are currently None and if so either don't initialise the logger or make sure that all logging is sent to a file.
Hope that helps. Steve From: [email protected] <[email protected]> On Behalf Of Glen Rubin Sent: 16 February 2023 14:54 To: PyInstaller <[email protected]> Subject: [PyInstaller] application fails in no-console mode My 'compiled' application fails, but only on Windows when setting console option to False. At fail i get the error: Failed to execute script 'main' due to unhandled exception: maximum recursion depth exceeded with a very long traceback that looks like this: Traceback (most recent call last): File "logging\__init__.py", line 1103, in emit AttributeError: 'NoneType' object has no attribute 'write' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "logging\__init__.py", line 1103, in emit AttributeError: 'NoneType' object has no attribute 'write' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "logging\__init__.py", line 1103, in emit AttributeError: 'NoneType' object has no attribute 'write' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "logging\__init__.py", line 1103, in emit AttributeError: 'NoneType' object has no attribute 'write' This repeats a few thousand times and then prints: Traceback (most recent call last): File "logging\__init__.py", line 1103, in emit AttributeError: 'NoneType' object has no attribute 'write' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "kivy\logger.py", line 248, in emit File "kivy\logger.py", line 222, in _configure File "logging\__init__.py", line 1477, in info File "logging\__init__.py", line 1624, in _log File "logging\__init__.py", line 1634, in handle File "logging\__init__.py", line 1696, in callHandlers File "logging\__init__.py", line 968, in handle File "logging\__init__.py", line 1108, in emit File "logging\__init__.py", line 1021, in handleError File "kivy\logger.py", line 338, in write File "logging\__init__.py", line 1489, in warning File "logging\__init__.py", line 1624, in _log File "logging\__init__.py", line 1634, in handle File "logging\__init__.py", line 1696, in callHandlers File "logging\__init__.py", line 968, in handle File "logging\__init__.py", line 1108, in emit File "logging\__init__.py", line 1021, in handleError File "kivy\logger.py", line 338, in write File "logging\__init__.py", line 1489, in warning File "logging\__init__.py", line 1624, in _log File "logging\__init__.py", line 1634, in handle File "logging\__init__.py", line 1696, in callHandlers File "logging\__init__.py", line 968, in handle File "logging\__init__.py", line 1108, in emit File "logging\__init__.py", line 1021, in handleError File "kivy\logger.py", line 338, in write File "logging\__init__.py", line 1489, in warning File "logging\__init__.py", line 1624, in _log File "logging\__init__.py", line 1634, in handle File "logging\__init__.py", line 1696, in callHandlers File "logging\__init__.py", line 968, in handle File "logging\__init__.py", line 1108, in emit File "logging\__init__.py", line 1021, in handleError File "kivy\logger.py", line 338, in write File "logging\__init__.py", line 1489, in warning ... -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/dfcf25c5-9da5-4802-88e4-fc72a2d8586en%40googlegroups.com<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fpyinstaller%2Fdfcf25c5-9da5-4802-88e4-fc72a2d8586en%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7C%7C10f7ef70440d45ddb2d408db10316935%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638121576622707997%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OBeKX8R97eBvE2eFr9KUrv%2FzR43iRVuXWsG5kg8ofao%3D&reserved=0>. -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/DU0P194MB18197302A991A9553CC82EB69BA09%40DU0P194MB1819.EURP194.PROD.OUTLOOK.COM.
