Message17825
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.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:16:11 | admin | link | issue790356 messages |
2007-08-23 14:16:11 | admin | create | |
|