From owner-freebsd-python@freebsd.org Thu Nov 19 04:58:47 2015 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CFDBA321F1 for ; Thu, 19 Nov 2015 04:58:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 215651345 for ; Thu, 19 Nov 2015 04:58:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by ykba77 with SMTP id a77so95581688ykb.2 for ; Wed, 18 Nov 2015 20:58:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=rD6ZIEURIxOX0OkxYKFhc7ilnnBzLszaifjQRIMrlmY=; b=qWgXt8+l9op9pxkYtMQE9OWD6K4P+qTnX/kRqo685XxjpMXPXNPVrxJMr6kuOBWRG/ 4ACaWuLkDKjFfMC4kDoSiCkp9Mfrk+nhykA1+NqeFrHeU0vJaQBBSOCIRPtFeomy4wwC NTxA0BSY1cRCT0AwRzj4eBQ1ok2NJ+WoaZMBHF8q7NLvKwQ6SQ6bSvu81E9B09n5ARVv /+DOIf/E43QXpRYfPWGS556nz44p/G+A1gly304ppCmErRxxpV0OT4mWjf2RLhjgE9AB M0Kn+t3hr+Q5WqvPpNw8GKxfEQR+ViY28vDqbFmucAyRD+8AS1oYsWvmiqyjD3fYEWj9 Dn2A== MIME-Version: 1.0 X-Received: by 10.129.0.8 with SMTP id 8mr5234778ywa.81.1447909126059; Wed, 18 Nov 2015 20:58:46 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.37.95.9 with HTTP; Wed, 18 Nov 2015 20:58:46 -0800 (PST) In-Reply-To: <564D4739.1090504@gmail.com> References: <564D4739.1090504@gmail.com> Date: Wed, 18 Nov 2015 20:58:46 -0800 X-Google-Sender-Auth: Bag-p2IOZ5ANlVhKLhi6h9_jLqA Message-ID: Subject: Re: Python curses module does not print any attributed space character on FreeBSD 11-current From: Craig Rodrigues To: raviqqe Cc: freebsd-python@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2015 04:58:47 -0000 On Wed, Nov 18, 2015 at 7:51 PM, raviqqe 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