Message28713
| Author |
unixops1234 |
| Recipients |
| Date |
2006年06月05日.22:34:08 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
There is a problem displaying extended ascii characters
in ncurses through python, which does not exist in
versions prior to 2.4.2. I am running RedHat Enterprise
Linux WS 3 with updated patches, using the system
version of ncurses (ncurses-5.3-9.4 and devel). When
building a vanilla python 2.4.3 from source, printing
extended ascii characters in ncurses fails:
$ cat test.py
import curses
screen = curses.initscr()
screen.addstr("\x80")
screen.getch()
curses.endwin()
$ python test.py
Traceback (most recent call last):hon test.py
File "test.py", line 5, in ?
screen.addstr("\x80")
_curses.error: addstr() returned ERR
This should produce a blank ncurses screen, rather than
the addstr() error. I've been able to confirm that it
works with python 2.4.2 and earlier.
To ensure that ncurses was able to display the
character, I wrote this test C program:
$ cat test.c
#include <ncurses.h>
int main()
{
initscr();
int rtn = addstr("\x80");
getch();
endwin();
printf("The return value was %d.\n",rtn);
return 0;
}
$ gcc test.c -o test -lncurses
$ ./test
This works just fine, so I think the problem lies
somewhere in the python interface to ncurses. Python
can print this character without errors when not using
ncurses. Perhaps ncurses is expecting different
initialization than python is providing.
I've also tested this on a RedHat WS 4 machine, where
it works just fine. This system is running
ncurses-5.4-13 and ncurses-devel-5.4-13. It seems the
newer release of python has changed something that the
older versions of ncurses are unable to handle.
Can this be fixed in _cursesmodule.c? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:40:24 | admin | link | issue1501291 messages |
| 2007年08月23日 14:40:24 | admin | create |
|