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

readline segfaults with python 3.7.2 #1

Open
jlquinn opened this issue Apr 1, 2019 · 7 comments
Open

readline segfaults with python 3.7.2 #1

jlquinn opened this issue Apr 1, 2019 · 7 comments

Comments

@jlquinn
Copy link

jlquinn commented Apr 1, 2019

Hi, I discovered the rename the hard way. I install python 3.7.2 on Ubuntu 16.04 and installed readline through pip3. Python now segfaults. I traced it down to the readline pip package. I was able to find that gnureadline is the replacement.

Please prevent readline from matching recent python because of the segfault problem. It definitely breaks 3.7.2 and I see reports that 3.6 breaks as well. This will help prevent surprises. Thanks!

@ludwigschwardt
Copy link
Owner

Good idea. Just remember that there is absolutely no reason to install readline or gnureadline on Ubuntu, since Linux Pythons typically ship with readline included (unless you are using ActiveState Python or some other non-standard distribution - I'm curious to know your setup :-)).

@jlquinn
Copy link
Author

jlquinn commented Apr 3, 2019

I'm wanting to use python 3.7 on Ubuntu 16.04. The default version is 3.5, which is why I'm building my own python.

@ludwigschwardt
Copy link
Owner

Ah, good point. Why do you need readline separately though? Readline 6.3 should be available on 16.04, which is the same version embedded in the gnureadline package.

@jlquinn
Copy link
Author

jlquinn commented Apr 5, 2019

Ah, perhaps I'm confused. On python 2.7 I had to install the readline pip package because without that, there was no readline support. I assumed the same was true for python 3.7. Am I missing something?

@ludwigschwardt
Copy link
Owner

ludwigschwardt commented Apr 5, 2019

If you are building Python from the source tarballs provided at python.org, it might be that you are missing the headers / include files for optional dependencies like readline, zlib, etc.

For example, on Ubuntu 16.04 you would want to do (see the Python developer's guide for more info)

sudo apt-get build-dep python3.5

since the dependencies have not changed (or very little) from 3.5 to 3.7.

Specifically, for readline support you need the libreadline-dev Ubuntu package to be installed before building Python from source.

Readline support in this case can be added afterwards via the readline package, but that is not the purpose of this package. It is meant for systems that lack readline completely or has an incompatible replacement, while still being Posix compliant. That pretty much narrows it down to macOS... Although ActiveState Python on Linux also benefits from this due to its licensing restrictions.

@jlquinn
Copy link
Author

jlquinn commented Apr 6, 2019

Thank you. This makes a lot more sense now.

@ludwigschwardt
Copy link
Owner

Glad to be of help! I'll still take up this issue though - no need to crash knowingly.

ludwigschwardt added a commit to ludwigschwardt/python-gnureadline that referenced this issue Jun 24, 2022
The Modules/3.x/readline.c is from Python 3.3, so don't go beyond that.

Also do a basic compiler fix by dropping i386 on macOS 10.9+ and adding
arm64 on macOS 11+ (FWIW :-)). This would allow older Pythons to use
this on newer macOSes (but please don't do that!). I have verified the
combination of Python 3.3.7 and macOS 11.6.6.

Hopefully this will block readline from getting installed on modern
systems in a more sensible way, by complaining about Python instead of
crashing during compilation. I prefer this to complete removal of the
package, since someone somewhere might still depend on it.

It would be nice if pip had a way to convey a message to the user to
switch to gnureadline instead after failing on the Python version.

This fixes ludwigschwardt/python-readline#1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants