You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I trust you can help me. I am successfully extracting MT940 from a text file, on Mac and Windows. When I then use PyInstaller to create an exe (on Windows), I get the following error (but not in my IDE) and traceback:
File "modules\gui.py", line 550, in __on_timer
File "modules\playbot.py", line 284, in run
File "modules\playbot.py", line 1984, in _run_process
File "modules\playbot.py", line 2035, in __call_function
File "modules\playbot.py", line 1037, in _extract_mt940
File "modules\files.py", line 454, in file_open_mt940
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
File "mt940\__init__.py", line 3, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
File "mt940\json.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
File "mt940\models.py", line 13, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
File "mt940\_compat.py", line 117, in <module>
AttributeError: 'NoneType' object has no attribute 'encoding'
As I've mentioned, this works when my app is not an executable, but fails when it is.
In case it helps, here is my code where I catch this exception:
The library currently expects sys.stdout to be available in some form or another. In your cases it appears to be None. You could monkeypatch it from your code like this:
import io
import sys
if sys.stdout is None:
sys.stdout = io.StringIO()
if sys.stderr is None:
sys.stderr = io.StringIO()
Hi
I trust you can help me. I am successfully extracting MT940 from a text file, on Mac and Windows. When I then use PyInstaller to create an exe (on Windows), I get the following error (but not in my IDE) and traceback:
As I've mentioned, this works when my app is not an executable, but fails when it is.
In case it helps, here is my code where I catch this exception:
I look forward to hearing from you.
Kind regards
Cedric
The text was updated successfully, but these errors were encountered: