Bug 13142

Summary: Python3 curses module isn't complete
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Alexander Kanavin <alex.kanavin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher
Version: 2.6.2   
Target Milestone: 2.7 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2019-01-16 12:33:05 UTC
python-native:

$ ./python3
Python 3.5.6 (default, Mar  9 2018, 12:34:56)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>> curses.unget_wch()
AttributeError: module 'curses' has no attribute 'unget_wch'

https://docs.python.org/3/library/curses.html#curses.unget_wch

My host python3 on Debian works:

>>> curses.unget_wch()
_curses.error: must call initscr() first

https://github.com/python/cpython/blob/master/Modules/_cursesmodule.c#L1320 shows that this is dependent on finding libncursesw, but libncursesw.so.5.9 is in the sysroot.

So, something in either upstream configure scripts or our numerous patches to Python, is breaking it.  Or maybe Debian have a patch we need?
Comment 1 Alexander Kanavin 2019-01-16 15:14:09 UTC
I can look into it, but I was also just about to start the python-sanity project... :)
Comment 2 Richard Purdie 2019-01-17 15:37:25 UTC
A test case which tests this would be great as this keeps getting broken.
Comment 3 Alexander Kanavin 2019-01-18 11:24:50 UTC
This was actually broken from the start, as one of the recipe patches forces python to build with ncurses (not the wide-char version ncursesw). Should be a simple one-liner fix:

http://lists.openembedded.org/pipermail/openembedded-core/2019-January/278183.html