Python3 problem on FreeBSD with curses

Matthias Apitz guru at unixarea.de
Thu Nov 22 10:24:07 UTC 2018


Hello,

I encounter a Phyton3 problem with the curses function

	k = stdscr.get_wch()

The problem exists only on FreeBSD. The same code works nicely on any Linux.
On FreeBSD it gives:

$ python3 curtest.py
Traceback (most recent call last):
  File "curtest.py", line 93, in <module>
    main()
  File "curtest.py", line 90, in main
    curses.wrapper(draw_menu)
  File "/usr/local/lib/python3.5/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "curtest.py", line 87, in draw_menu
    k = stdscr.get_wch()
AttributeError: '_curses.curses window' object has no attribute 'get_wch'

The code for curtest.py is here: http://www.unixarea.de/curtest.py 
It's a simple demo program which reads one char after another, prints
it in a curses window and exits on pressed 'q'.

What could be wrong with our Pythos3 on FreeBSD:

FreeBSD r314251-amd64 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r314251: Sat
Feb 25 17:14:40 CET 2017
root at r303343-amd64:/usr/obj/usr/src/sys/GENERIC  amd64

Thanks

	matthias


-- 
Matthias Apitz, ✉ guru at unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


More information about the freebsd-questions mailing list