Seems to be OK in my system python.  Strange?

[EMAIL PROTECTED]:~$ python
Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> readline.__file__
'/usr/lib/python2.5/lib-dynload/readline.so'
>>> dir(readline)
['__doc__', '__file__', '__name__', 'add_history', 'clear_history', 
'get_begidx', 'get_completer', 'get_completer_delims', 
'get_current_history_length', 'get_endidx', 'get_history_item', 
'get_history_length', 'get_line_buffer', 'insert_text', 'parse_and_bind', 
'read_history_file', 'read_init_file', 'redisplay', 'remove_history_item', 
'replace_history_item', 'set_completer', 'set_completer_delims', 
'set_history_length', 'set_pre_input_hook', 'set_startup_hook', 
'write_history_file']
>>>
[EMAIL PROTECTED]:~$ ldd /usr/lib/python2.5/lib-dynload/readline.so
         linux-gate.so.1 =>  (0xffffe000)
         libreadline.so.5 => /lib/libreadline.so.5 (0xb7f95000)
         libncursesw.so.5 => /lib/libncursesw.so.5 (0xb7f47000)
         libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7f2f000)
         libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7dee000)
         libncurses.so.5 => /lib/libncurses.so.5 (0xb7dab000)
         libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7da7000)
         /lib/ld-linux.so.2 (0x80000000)
[EMAIL PROTECTED]:~$ strings /lib/libreadline.so.5 | grep clear_history
clear_history
[EMAIL PROTECTED]:~$ strings /usr/lib/python2.5/lib-dynload/readline.so | grep 
clear_history
clear_history
clear_history
clear_history() -> None



On Thu, 10 May 2007, Fernando Perez wrote:

>
> On 5/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> [EMAIL PROTECTED]:~$ sage/sage -python
>> Python 2.5.1 (r251:54863, May 10 2007, 15:24:24)
>> [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import readline
>>>>> readline.__file__
>> '/home/boothby/sage/local/lib/python2.5/lib-dynload/readline.so'
>>>>> dir(readline)
>> ['__doc__', '__file__', '__name__', 'add_history', 'get_begidx', 
>> 'get_completer', 'get_completer_delims', 'get_current_history_length', 
>> 'get_endidx', 'get_history_item', 'get_history_length', 'get_line_buffer', 
>> 'insert_text', 'parse_and_bind', 'read_history_file', 'read_init_file', 
>> 'redisplay', 'remove_history_item', 'replace_history_item', 'set_completer', 
>> 'set_completer_delims', 'set_history_length', 'set_startup_hook', 
>> 'write_history_file']
>
> This is odd.  Try the same thing with your system python so we can
> look for differences.  Somehow it seems the readline in SAGE python is
> missing two things:
>
> clear_history
> set_pre_input_hook
>
> clear_history was added to Python ages ago:
>
> http://osdir.com/ml/python.patches/2003-09/msg00139.html
>
> So I'm a bit at a loss as to what the hell is going on in your box.
> Let's check:
>
> planck[~]> strings /lib/libreadline.so.5 | grep clear_history
> clear_history
>
>
> so we at least know that your base readline DOES have clear_history
> (it would be very odd if it didn't).  Also do the same on both the
> system python readline module and the SAGE one:
>
> planck[~]> strings /usr/lib/python2.5/lib-dynload/readline.so | grep
> clear_history
> clear_history
> clear_history
> clear_history() -> None
>
>
> I'm very puzzled...  Nothing in the Python changelog mentions this
> function having been removed:
>
> http://www.python.org/download/releases/2.5.1/NEWS.txt
>
>
> Cheers,
>
> f
>
> >
>



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to