Repository navigation
Closed
Labels
OS-windowsextension-modulesC modules in the Modules dirrelease-blockertype-bugAn unexpected behavior, bug, or error
Description
| BPO | 5410 |
|---|---|
| Nosy | @pitrou, @vstinner, @benjaminp |
| Dependencies | |
| Files |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2009-05-01.21:42:45.276>
created_at = <Date 2009-03-03.11:56:13.175>
labels = ['extension-modules', 'type-bug', 'OS-windows', 'release-blocker']
title = 'msvcrt bytes cleanup'
updated_at = <Date 2009-05-01.21:42:45.274>
user = 'https://bugs.python.org/ocean-city'bugs.python.org fields:
activity = <Date 2009-05-01.21:42:45.274>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2009-05-01.21:42:45.276>
closer = 'benjamin.peterson'
components = ['Extension Modules', 'Windows']
creation = <Date 2009-03-03.11:56:13.175>
creator = 'ocean-city'
dependencies = ['5499']
files = ['13233', '13351', '13718']
hgrepos = []
issue_num = 5410
keywords = ['patch']
message_count = 11.0
messages = ['83071', '83685', '83686', '85182', '85410', '85426', '85455', '85461', '86124', '86125', '86916']
nosy_count = 4.0
nosy_names = ['pitrou', 'vstinner', 'ocean-city', 'benjamin.peterson']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue5410'
versions = ['Python 3.1']Metadata
Metadata
Assignees
Labels
OS-windowsextension-modulesC modules in the Modules dirrelease-blockertype-bugAn unexpected behavior, bug, or error
Activity
ocean-city commentedon Mar 3, 2009
I came from bpo-5391. Here is quote of Victor's message.
And msvcrt.ungetwch() calls _ungetch not _ungetwch. Here is the patch
hopefully fixing these issue. (I cannot test wide version of functions
because VC6 don't have them)
vstinner commentedon Mar 17, 2009
... are you sure that someone already used these functions? :-)
If you suppose that bpo-5499 is fixed, you can leave msvcrt_putch()
and msvcrt_ungetch unchanged and use "C" format in msvcrt_ungetwch()
("Py_UNICODE ch;" have to be replaced by "int ch;" for the
format "C").
vstinner commentedon Mar 17, 2009
Patch implementing my proposition (depends on bpo-5499).
vstinner commentedon Apr 2, 2009
bpo-5499 is fixed, so msvcrt_wchar.patch can now be used :-) Anyone
available for a review and/or _a test_? I don't have Windows, so it's
hard for me to test my patch.
pitrou commentedon Apr 4, 2009
There seems to be a problem with ungetwch():
benjaminp commentedon Apr 4, 2009
I think this can wait until the first beta.
vstinner commentedon Apr 5, 2009
I tested Visual C++ Express 2008 and it looks like _ungetwch() only
keep 8 lower bits (like _ungetwch(x & 255)). But it's a bug in
Microsoft library, not in Python code (I added some printf to be
sure).
My patch (msvcrt_wchar.patch) makes the situation better, but it's not
perfect because of a bug in Microsoft's library.
msvcrt.getwch() works correctly with characters with code > 255 (eg.
euro sign, U+20ac, 8364 in decimal).
ocean-city commentedon Apr 5, 2009
MSDN says _ungetwch returns WEOF instead of EOF when error occurs.
http://msdn.microsoft.com/en-us/library/yezzac74(VS.80).aspx
I cannot see any remarks about masking behavior. :-(
vstinner commentedon Apr 18, 2009
I asked on a french Windows developer channel. The answer is that the
Windows terminal uses "ANSI" charset even if it's possible to use
unicode. So it's a bug in Microsoft msvcrt library (directly in the
terminal implementation), not in Python.
Anyway I think that my patch (msvcrt_wchar.patch) makes the situation
better ;-)
vstinner commentedon Apr 18, 2009
Ok, I updated my patch (to use WEOF).
benjaminp commentedon May 1, 2009
Applied in r72185.