Issue 1450019: Build of readline fails (original) (raw)
I was attempting to compile Python-2.3.5 under Fedora Core 4:
Python 2.3.5 (#14, Mar 14 2006, 17:57:17) [GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
and needed it to have readline support
No matter how I compiled it, the readline module was never built, and of course readline functionality did not work.
I tried ./configure --with-readline=/usr and a couple of other configure options that I thought would help, but nothing worked. Finally, I tried:
make Modules/readline
which gave the error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -L/home/sweidman/Applications/Python-2.3.5 Modules/readline.c -o Modules/readline Modules/readline.c:96: error: static declaration of ‘history_length’ follows non-static declaration /usr/include/readline/history.h:242: error: previous declaration of ‘history_length’ was here make: *** [Modules/readline] Error 1
So without knowing what I was really doing, I commented out the definition of history_length at Modules/readline.c:96
After making that change, Python-2.3.5 compiled and ran fine with readline support working; i.e. "import readline" gave no errors and the arrow keys bring back the last command.
So is this a bug or a quirk on my platform or something else I'm doing wrong?
Thanks for the great software!!
Logged In: YES user_id=33168
Python 2.3 isn't supported any longer. In the current version, it looks like history_length was renamed to prepend an underscore (ie, the name became: _history_length). This was presumably to fix the same problem. The name also changed in write_history_file(), set_history_length(), and get_history_length().
It's not so much anything you are doing wrong, just a compatability problem, since FC4 is quite a bit newer than Python 2.3. If you upgrade to Python 2.4, you shouldn't have the problem, or you can run with your local modification.