[issue1754] WindowsError messages are not properly encoded

2017-06-27 Thread alberfontan1
Changes by alberfontan1 : -- pull_requests: +2490 ___ Python tracker ___ ___

[issue1754] WindowsError messages are not properly encoded

2010-08-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Should we close this? There was some opinion that this is not a bug. The argument for not closing this before 3.0 will be a long way away for many users. is obsolete as 3.1.2 is here and 3.2 will be in less than 6 months. Or, Amaury, do you

[issue1754] WindowsError messages are not properly encoded

2010-08-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Somebody should investigate the status of this on 3.x. If the message comes out as a nice Unicode string, I'd close it as fixed. If the message comes out as a byte string, it definitely needs fixing. For 2.x, the issue is out of date.

[issue1754] WindowsError messages are not properly encoded

2010-08-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: The message is definitely an str (unicode) string. WinXP,3.1.2, import os try: os.rmdir('nonexist') except Exception as e: print(repr(e.args[1]), '\n', repr(e.strerror), '\n', e.filename) os.rmdir('nonexist') # prints 'The system cannot

[issue1754] WindowsError messages are not properly encoded

2010-05-05 Thread Romulo A. Ceccon
Romulo A. Ceccon romulocec...@gmail.com added the comment: I think WindowsError's message should be English like other errors. FormatMessageW() function can take dwLanguageId parameter. So I think Python should pass `MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)` to the parameter. On a

[issue1754] WindowsError messages are not properly encoded

2010-01-14 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: I think WindowsError's message should be English like other errors. FormatMessageW() function can take dwLanguageId parameter. So I think Python should pass `MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)` to the parameter. -- nosy:

[issue1754] WindowsError messages are not properly encoded

2009-01-27 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt eckha...@satorlaser.com: -- nosy: +eckhardt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1754 ___ ___ Python-bugs-list

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Crys, can you confirm this? It would seem we'll need to fix this twice -- once for 2.x, once for 3.0. -- nosy: +gvanrossum, tiran __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1754

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Christian Heimes
Christian Heimes added the comment: Oh nice ... Amaury knows probably more about the wide char Windows API than me. The function Python/error.c:PyErr_SetExcFromWindows*() needs to be modified. -- assignee: - amaury.forgeotdarc nosy: +amaury.forgeotdarc priority: - normal versions:

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I confirm the problem (with French accents) on python 2.5. Python 3.0 already fixed the problem by using the FormatMessageW() unicode version of the API. We could do the same for python 2.5, but the error message must be converted to str early (i.e when

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Romulo A. Ceccon
Romulo A. Ceccon added the comment: ... but the error message must be converted to str early (i.e when building the Exception). Wouldn't that create more problems? What if somebody wants to intercept the exception and do something with it, like, say, redirect it to a log file? The programmer

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I think this is not possible if we want to preserve compatibility; at least, str(e.strerror) must not fail. I can see different solutions: 1) Don't fix, and upgrade to python 3.0 2) Store an additional e.unicodeerror member, use it in a new

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: I would claim that this is not a bug. Sure, the message doesn't come out correctly, but only because you run it in a cmd.exe window, not in (say) IDLE. IIUC, the problem is that Python computes the message in CP_ACP (i.e. the ANSI code page), whereas the

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Forcing English messages would certainly reduce the problems And it does not even work: my French Windows XP does not contain the English error messages :-( If we declare that all strings are considered as CP_ACP in the exception, then the only way to

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: If this is chosen, I propose to use CharToOem as the unfailing conversion function. I will try to come with a patch following this idea. Sounds fine to me. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1754

[issue1754] WindowsError messages are not properly encoded

2008-01-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Here is a patch. Now I feel it is a hack, but it is the only place I found where I can access both the exception object and the encoding... Added file: http://bugs.python.org/file9100/windowserror.patch __ Tracker [EMAIL