[Python-bugs-list] [ python-Bugs-790356 ] curses.ascii.unctrl broken
SourceForge.net
noreply at sourceforge.net
Sun Aug 17 22:09:36 EDT 2003
Bugs item #790356, was opened at 2003-08-18 00:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=790356&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Cinege (dcinege)
Assigned to: Nobody/Anonymous (nobody)
Summary: curses.ascii.unctrl broken
Initial Comment:
unctrl(c)
Return a string representation of the ASCII character c. If c
is printable, this string is the character itself. ...
from curses.ascii import unctrl
>>> unctrl('a')
'a'
>>> unctrl('A')
'^\x81'
unctrl() is not working for the full printable charset.
The Q&D fix is:
def unctrl(c):
+ if isprint(c):
+ return c
bits = _ctoi(c)
if bits == 0x7f:
This bug has been confirmed in python 2.3 and 2.2 as
distributed in Debian Linux.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=790356&group_id=5470
More information about the Python-bugs-list
mailing list