Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curses: Link against libncursesw instead of libncurses #53654

Closed
vstinner opened this issue Jul 28, 2010 · 8 comments
Closed

curses: Link against libncursesw instead of libncurses #53654

vstinner opened this issue Jul 28, 2010 · 8 comments
Labels
stdlib Python modules in the Lib dir topic-unicode

Comments

@vstinner
Copy link
Member

BPO 9408
Nosy @akuchling, @mdickinson, @pitrou, @vstinner, @ashemedai, @merwok, @bitdancer, @skrah

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-03-20.00:39:36.064>
created_at = <Date 2010-07-28.23:49:50.650>
labels = ['library', 'expert-unicode']
title = 'curses: Link against libncursesw instead of libncurses'
updated_at = <Date 2012-03-20.00:39:36.063>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2012-03-20.00:39:36.063>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2012-03-20.00:39:36.064>
closer = 'vstinner'
components = ['Library (Lib)', 'Unicode']
creation = <Date 2010-07-28.23:49:50.650>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 9408
keywords = []
message_count = 8.0
messages = ['111875', '116056', '116058', '116070', '119506', '119508', '140425', '156374']
nosy_count = 10.0
nosy_names = ['akuchling', 'mark.dickinson', 'pitrou', 'vstinner', 'asmodai', 'eric.araujo', 'rpetrov', 'Arfrever', 'r.david.murray', 'skrah']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue9408'
versions = ['Python 3.2']

@vstinner
Copy link
Member Author

Because of bpo-7384, Python3 now links _curses.so to ncurses library (bytes version) instead of ncursesw library (unicode version) if readline is linked to ncurses. I'm using Linux (Debian Sid).

On Linux, Python3 should maybe only link to the unicode version, because the bytes version has many issues with unicode and lacks many functions.

See also:

  • bpo-1428494: "Prefer linking against ncursesw over ncurses library" (so I consider this issue as a regression).
  • bpo-4787

(reuse the nosy list from bpo-7384)

@vstinner vstinner added stdlib Python modules in the Lib dir topic-unicode labels Jul 28, 2010
@vstinner
Copy link
Member Author

Does anyone agree with me?

@skrah
Copy link
Mannequin

skrah mannequin commented Sep 10, 2010

Just a short explanation:

In bpo-7384 I used the strict version of the patch for 2.7/3.2 because Thomas Dickey recommended not to load readline+ncurses and ncursesw
at the same time.

Actually the distros should either link readline against libtinfo
(Fedora) or only use ncursesw (DragonFly).

If someone feels confident that on Linux the linker can safely handle
conflicting global symbols in this situation, the patch for 2.6/3.1
could be used.

@vstinner
Copy link
Member Author

$ ldd $(/usr/bin/python3.1 -c 'import readline; print(readline.__file__)')|grep curses
        libncurses.so.5 => /lib/libncurses.so.5 (0xb7537000)
$ ldd /lib/libreadline.so.6|grep curses
        libncurses.so.5 => /lib/libncurses.so.5 (0xb76a6000)

Actually the distros should either link readline
against libtinfo (Fedora) or only use ncursesw (DragonFly).

Ok, I should maybe open a *Debian* bug to ask to link readline to ncursesw (and another to ensure that Python3 is also liked to ncursesw).

@skrah
Copy link
Mannequin

skrah mannequin commented Oct 24, 2010

There are two issues here:

(1) If libreadline is already linked against ncurses, there is no way that
the readline module should be linked against ncursesw. This was the
direct cause of the FreeBSD segfault, so this configuration is also
prohibited in 2.6/3.1.

(2) Interaction between the readline and curses modules: 2.6/3.1 still
allow readline+ncurses with curses+ncursesw. To be on the safe side,
2.7/3.2 enforce all ncurses or all ncursesw.

(1) implies that if your readline module is linked against ncurses in 3.1,
you should find that libreadline is also linked against ncurses.

@skrah
Copy link
Mannequin

skrah mannequin commented Oct 24, 2010

Hmm, I understood that your ldd lines implied that things don't work as
intended in 3.1, hence the explanation. Perhaps this wasn't the case. :)

@pitrou
Copy link
Member

pitrou commented Jul 15, 2011

For the record, I filed the following bug against Mageia's libreadline:
https://bugs.mageia.org/show_bug.cgi?id=2156

@vstinner
Copy link
Member Author

I should maybe open a *Debian* bug

Done:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602720

I don't think that we should drop support of libncurses because it is still the only option on some OSes. I'm closing the issue because it is now fixed in Debian which was my initial concern.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-unicode
Projects
None yet
Development

No branches or pull requests

2 participants