Mar-25-2024, 02:23 AM
Hello everyone,
I've developed a Python application and distributed it to users.
Most of them are not experiencing any issues, but on some users' PCs, an error occurs with the following function:
Since the code works on most users' PCs, I don't think the issue lies with my code,
but I'm stumped about where the problem might be or what I'm missing.
In my attempts to troubleshoot,
I learned that create_unicode_buffer is a function for allocating memory,
and the failure indicates a memory allocation issue.
However, this function doesn't usually require a lot of memory.
I wondered if it was a 32-bit vs. 64-bit issue,
so I checked and confirmed that my program was compiled with Python 64-bit, and the affected user's PC (i7 12th gen, 16GB RAM) also runs a 64-bit OS, so that doesn't seem to be the problem either.
Considering it might be an issue with the version of the Visual C++ Runtime Library,
I advised the user to uninstall their current library, install the latest version, and then reboot, but the error persists.
I've been at this for days and just can't seem to figure out what I'm missing.
Any guidance or suggestions would be greatly appreciated. Thank you!
I've developed a Python application and distributed it to users.
Most of them are not experiencing any issues, but on some users' PCs, an error occurs with the following function:
# Code to find window handles for the program named 'ABC ' winhandle_list = pywinauto.findwindows.find_windows(title="ABC ")The runtime error log saved in the logfile is as follows:
ERROR:root:Traceback (most recent call last): File "my_qt.py", line 952, in find_abc_windows File "pywinauto\findwindows.py", line 344, in find_windows File "pywinauto\findwindows.py", line 273, in find_elements File "pywinauto\findwindows.py", line 273, in <listcomp> File "pywinauto\win32_element_info.py", line 83, in rich_text File "pywinauto\handleprops.py", line 92, in text File "ctypes\__init__.py", line 297, in create_unicode_buffer MemoryErrorI authored only the my_qt.py file, and within it, the find_abc_windows() function calls ~~~.find_windows().
Since the code works on most users' PCs, I don't think the issue lies with my code,
but I'm stumped about where the problem might be or what I'm missing.
In my attempts to troubleshoot,
I learned that create_unicode_buffer is a function for allocating memory,
and the failure indicates a memory allocation issue.
However, this function doesn't usually require a lot of memory.
I wondered if it was a 32-bit vs. 64-bit issue,
so I checked and confirmed that my program was compiled with Python 64-bit, and the affected user's PC (i7 12th gen, 16GB RAM) also runs a 64-bit OS, so that doesn't seem to be the problem either.
Considering it might be an issue with the version of the Visual C++ Runtime Library,
I advised the user to uninstall their current library, install the latest version, and then reboot, but the error persists.
I've been at this for days and just can't seem to figure out what I'm missing.
Any guidance or suggestions would be greatly appreciated. Thank you!