[issue22977] Unformatted “Windows Error 0x%X” exception message

Martin Panter report at bugs.python.org
Tue Dec 2 12:19:44 CET 2014


New submission from Martin Panter:

The following code generates a connection reset error on Wine (Windows emulator, because I don’t have actual Windows to test on). Probably only a minor issue, but the error message isn’t quite right:

>>> s = create_connection(("localhost", 8181))
>>> # Server end accepts connection and then closes it
>>> s.sendall(b"3" * 3000000)                 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ConnectionResetError: [WinError 10054] Windows Error 0x%X

I’m just guessing, but looking at Python/errors.c, there are two PyUnicode_FromFormat("Windows Error 0x%X", ...) calls. The documentation for that function says only a lower-case %x is supported, so that would explain the behaviour I am seeing.

----------
components: Windows
messages: 231987
nosy: steve.dower, tim.golden, vadmium, zach.ware
priority: normal
severity: normal
status: open
title: Unformatted “Windows Error 0x%X” exception message
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22977>
_______________________________________


More information about the Python-bugs-list mailing list