Python curses module does not print any attributed space character on FreeBSD 11-current
Craig Rodrigues
rodrigc at FreeBSD.org
Thu Nov 19 04:58:47 UTC 2015
On Wed, Nov 18, 2015 at 7:51 PM, raviqqe <raviqqe at gmail.com> wrote:
> Hello,
>
> TL;DR
> I encountered a bug-like behavior of a Python built-in module.
> Could you reproduce it in C?
>
> While working with Python and its curses module on FreeBSD 11-current
> (x86_64),
> I found a weird behavior of the module. The code below doesn't print any
> character
> although it should print a space on the upper-left corner.
>
> ```
> # test.py
>
> import curses
>
> window = curses.initscr()
> window.attrset(curses.A_NORMAL)
> window.addch(" ")
> window.getch()
> curses.endwin()
> ```
>
> The cause is `window.attrset()` and when I removed the line it works just
> fine.
> And, with the visible characters (such as 'A' and '?' except for ' ' and
> '\t'),
> it works fine even if window.attrset() is there.
>
> Hi,
I have a:
* FreeBSD-CURRENT system: built from Subversion revision r290830
* python27-2.710_1 (installed with pkg install lang/python )
* python35-3.5.0 (installed with pkg install lang/python35 )
I ran your test case, and did not encounter your problem.
For me, a space is printed in the top left.
Also, I see:
# ldd /usr/local/lib/python2.7/lib-dynload/_curses.so
/usr/local/lib/python2.7/lib-dynload/_curses.so:
libthr.so.3 => /lib/libthr.so.3 (0x801212000)
libncurses.so.8 => /lib/libncurses.so.8 (0x801437000)
libpython2.7.so.1 => /usr/local/lib/libpython2.7.so.1 (0x80168a000)
libc.so.7 => /lib/libc.so.7 (0x800822000)
libintl.so.8 => /usr/local/lib/libintl.so.8 (0x801a48000)
libutil.so.9 => /lib/libutil.so.9 (0x801c52000)
libm.so.5 => /lib/libm.so.5 (0x801e65000)
# ldd /usr/local/lib/python3.5/lib-dynload/_curses.so
/usr/local/lib/python3.5/lib-dynload/_curses.so:
libthr.so.3 => /lib/libthr.so.3 (0x801214000)
libncurses.so.8 => /lib/libncurses.so.8 (0x801439000)
libpython3.5m.so.1.0 => /usr/local/lib/libpython3.5m.so.1.0
(0x801800000)
libc.so.7 => /lib/libc.so.7 (0x800822000)
libintl.so.8 => /usr/local/lib/libintl.so.8 (0x801c9b000)
libutil.so.9 => /lib/libutil.so.9 (0x801ea5000)
libm.so.5 => /lib/libm.so.5 (0x8020b8000)
At least for me, the Python _curses.so is linking against ncurses.so.8.
--
Craig
More information about the freebsd-python
mailing list