[Ipython-tickets] [IPython] #189: History index bug when ipython is embedded in a GTK application

IPython ipython-tickets@scipy....
Wed Oct 10 08:46:04 CDT 2007


#189: History index bug when ipython is embedded in a GTK application
---------------------+------------------------------------------------------
 Reporter:  tom_l    |       Owner:  fperez
     Type:  defect   |      Status:  new   
 Priority:  normal   |   Milestone:        
Component:  ipython  |     Version:        
 Severity:  major    |    Keywords:        
---------------------+------------------------------------------------------
 I'm trying to embed an Ipython console in my GTK app.

 If you launch the script in
 [http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK] and do:

 {{{
 for i in range(5):
     print i
 }}}

 You get :


 {{{
 ---------------------------------------------------------------------------
 <type 'exceptions.ValueError'>            Traceback (most recent call
 last)

 /usr/lib/python2.5/site-packages/IPython/iplib.py in raw_input(self,
 prompt, continue_prompt)
    2039                         histlen =
 self.readline.get_current_history_length()
    2040                         newhist = self.input_hist_raw[-1].rstrip()
 -> 2041
 self.readline.remove_history_item(histlen-1)
    2042
 self.readline.replace_history_item(histlen-2,newhist)
    2043                     except AttributeError:

 <type 'exceptions.ValueError'>: History index cannot be negative
    ...:
 }}}


 I use the package present in the Ubuntu Feisty repositories and the
 ipython_view.py file present on the webpage:
 [http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK]

-- 
Ticket URL: <http://ipython.scipy.org/ipython/ipython/ticket/189>
IPython <http://ipython.scipy.org>
The IPython interactive Python system


More information about the Ipython-tickets mailing list