Date: Thu, 22 Nov 2018 14:03:18 +0300 From: Yuri Pankov <yuripv@yuripv.net> To: freebsd-questions@freebsd.org Subject: Re: Python3 problem on FreeBSD with curses Message-ID: <c52094c4-b5db-bacc-8f12-6ccec3bf0f3f@yuripv.net> In-Reply-To: <9c646b7e-11cb-062d-490a-5f6570807a1f@yuripv.net> References: <20181122102357.GA24213@sh4-5.1blu.de> <9c646b7e-11cb-062d-490a-5f6570807a1f@yuripv.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --34Z8s37WSrY7BFcUcAaJFNcxP08zApA7m Content-Type: multipart/mixed; boundary="EF3PTfghoHsc8aPJEF3FYprEbHO4yF6RV"; protected-headers="v1" From: Yuri Pankov <yuripv@yuripv.net> To: freebsd-questions@freebsd.org Message-ID: <c52094c4-b5db-bacc-8f12-6ccec3bf0f3f@yuripv.net> Subject: Re: Python3 problem on FreeBSD with curses References: <20181122102357.GA24213@sh4-5.1blu.de> <9c646b7e-11cb-062d-490a-5f6570807a1f@yuripv.net> In-Reply-To: <9c646b7e-11cb-062d-490a-5f6570807a1f@yuripv.net> --EF3PTfghoHsc8aPJEF3FYprEbHO4yF6RV Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Yuri Pankov wrote: > Matthias Apitz wrote: >> >> Hello, >> >> I encounter a Phyton3 problem with the curses function >> >> k =3D 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 wrap= per >> return func(stdscr, *args, **kwds) >> File "curtest.py", line 87, in draw_menu >> k =3D stdscr.get_wch() >> AttributeError: '_curses.curses window' object has no attribute 'get_w= ch' >> >> The code for curtest.py is here: http://www.unixarea.de/curtest.py=20 >> 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: Sa= t >> Feb 25 17:14:40 CET 2017 >> root@r303343-amd64:/usr/obj/usr/src/sys/GENERIC amd64 >=20 > I'm not a python guy at all, but looking at the OS and python versions,= > I thought it's worth mentioning that the example code you provided work= s > for me with python36-3.6.7 on FreeBSD 13.0-CURRENT r340744 > GENERIC-NODEBUG, using C.UTF-8 locale. Going through the lang/python35 log, the following entry looks particularly interesting: ---------------------------------------------------------------------- r444534 | dbaio | 2017-06-28 05:37:53 +0300 (Wed, 28 Jun 2017) | 29 lines= lang/python{27,33,34,35,36}: Make Python curses module work with Unicode [...] ---------------------------------------------------------------------- And again guessing on the timestamps in your uname output, it could be you are just missing this change. --EF3PTfghoHsc8aPJEF3FYprEbHO4yF6RV-- --34Z8s37WSrY7BFcUcAaJFNcxP08zApA7m Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlv2jPYACgkQk4vgf7Eq 4Wz28Af/SMaG7T3koCF7oEcjIvau6/TdFDvfiE6eupwTNQ9b0DDaUXj2U67VnElQ cpqqp2yHHxQqfsDE6M6pjVjtes+T4q0cA/wBYVfSiG8va4JugfhpBWq3WGiwTrEW l8dvbO3/WXoPkEo9v2ft/igS8mMkJc8uWZvUK9I7sbA0p6FIkd4rEGWPaYcLyO7z 4MJ5n5fG8bLQvwMFdkVnIz/P/AI8ufqHmXq/IhfupW5BSXyMnzoQcvCDQV90hv8D YX1UZZ/Zp4n3+GM7iTpR74D/orv44SAhNbJgWh8I9iM4V/jFxqeHJLrSsTbINGzB zsOXiWyVUjtIYSP9vr0/M7zXsQwhFQ== =NtNh -----END PGP SIGNATURE----- --34Z8s37WSrY7BFcUcAaJFNcxP08zApA7m--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c52094c4-b5db-bacc-8f12-6ccec3bf0f3f>