[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Serhiy Storchaka added the comment: Thanks for your outsight Arfrever. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Roundup Robot added the comment: New changeset 5cc0a090829a by Serhiy Storchaka in branch '3.4': Issue #22977: Remove unconditional import of ctypes. https://hg.python.org/cpython/rev/5cc0a090829a New changeset f46454229cf5 by Serhiy Storchaka in branch 'default': Issue #22977: Remove unconditional import of ctypes. https://hg.python.org/cpython/rev/f46454229cf5 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Arfrever Frehtes Taifersar Arahesis added the comment: Unconditional 'import ctypes' in Lib/test/test_exceptions.py was not yet deleted. -- nosy: +Arfrever resolution: fixed - stage: resolved - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
STINNER Victor added the comment: Oh, and the ctypes module (import) must be optional, just skip the test if ctypes is missing. http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/9555/steps/test/logs/stdio test test_exceptions crashed -- Traceback (most recent call last): File /export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/regrtest.py, line 1267, in runtest_inner the_module = importlib.import_module(abstest) File /export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/importlib/__init__.py, line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File frozen importlib._bootstrap, line , in _gcd_import File frozen importlib._bootstrap, line 2205, in _find_and_load File frozen importlib._bootstrap, line 2194, in _find_and_load_unlocked File frozen importlib._bootstrap, line 1153, in _load_unlocked File frozen importlib._bootstrap, line 1431, in exec_module File frozen importlib._bootstrap, line 321, in _call_with_frames_removed File /export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/test/test_exceptions.py, line 9, in module import ctypes File /export/home/buildbot/64bits/3.x.cea-indiana-amd64/build/Lib/ctypes/__init__.py, line 7, in module from _ctypes import Union, Structure, Array ImportError: No module named '_ctypes' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Roundup Robot added the comment: New changeset 7907746baa0d by Serhiy Storchaka in branch '3.4': Issue #22977: Fixed formatting Windows error messages on Wine. https://hg.python.org/cpython/rev/7907746baa0d New changeset cf0cac11813d by Serhiy Storchaka in branch 'default': Issue #22977: Fixed formatting Windows error messages on Wine. https://hg.python.org/cpython/rev/cf0cac11813d -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
STINNER Victor added the comment: On Python 3.4, windll.kernel32.RaiseException(2, 0, 0, None) raised a FileNotFound error. On Python 3.5, it displays a popup and the program exit. It looks like the behaviour of RaiseException() changed in Python 3.5. I tested in debug and release mode. @Steve: Any idea? -- Instead of RaiseException, you can use ctypes.pythondll.PyErr_SetFromWindowsErr(code). code = int.from_bytes(b\xE0msc, big) Why not writing directly code = 3765269347? The unit test should also check the exception message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Serhiy Storchaka added the comment: Yes, you are right. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Martin Panter added the comment: I don’t pretend to know what is going on, or the best way to fix it. That exit code is the same code that my test passes to RaiseException. Perhaps it would be best to disable the test until someone with more knowledge or a Windows compiler can investigate. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
STINNER Victor added the comment: I'm not sure that Windows appreciate your change :-) http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/6011/steps/test/logs/stdio [216/393] test_exceptions Traceback (most recent call last): File C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\..\lib\test\regrtest.py, line 1589, in module main_in_temp_cwd() File C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\..\lib\test\regrtest.py, line 1564, in main_in_temp_cwd main() File C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\..\lib\test\regrtest.py, line 738, in main raise Exception(Child error on {}: {}.format(test, result[1])) Exception: Child error on test_exceptions: Exit code 3765269347 -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Serhiy Storchaka added the comment: Could you provide a patch if you can test it Victor? -- assignee: serhiy.storchaka - stage: resolved - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Martin Panter added the comment: Thanks for fixing the test Victor. The ctypes.pythonapi trick looks like a much better way. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Roundup Robot added the comment: New changeset dafae2b3c257 by Victor Stinner in branch '3.4': Issue #22977: Fix test_exceptions https://hg.python.org/cpython/rev/dafae2b3c257 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Martin Panter added the comment: All the other occurrences of capitalized %X that I can find are not using Python’s string formatting functions. Please point them out if you can, but all I can see are some using a Microsoft vfwprintf_s() API, some calling standard C sprintf(), sscanf(), fprintf(), strftime() and strptime() APIs, and of course native Python 2-style string formatting, which I assume should all support %X. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Serhiy Storchaka added the comment: LGTM. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Serhiy Storchaka added the comment: There are other occurrences of %X in the code. Do you want provide a patch for them Martin? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Martin Panter added the comment: V3 patch with suggested changes to the test case, though still completely untested by me. -- Added file: http://bugs.python.org/file38641/win-error-format-v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
STINNER Victor added the comment: The attached patch lacks an unit test. When I will be able to build CPython again, I will try the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: - patch review versions: +Python 3.4, Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Martin Panter added the comment: This patch includes a test case, based on Eryksun’s exception code -- Added file: http://bugs.python.org/file37686/win-error-format-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Martin Panter added the comment: Here’s a simple patch which should fix it, although I have not verified this because I don’t have a Windows compiler (and MINGW cross compiling sounds too tricky) -- keywords: +patch Added file: http://bugs.python.org/file37678/win-error-format.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Unformatted “Windows Error 0x%X” exception message - Unformatted “Windows Error 0x%X” exception message on Wine ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22977 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com