jython and ipython

View: New views
3 Messages — Rating Filter:   Alert me  

jython and ipython

by Raghuram Devarakonda-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to run ipython (0.10) using jython built from trunk and I
get the following error:

-----
Traceback (most recent call last):
  File "ipython.py", line 10, in <module>
    import IPython.Shell
  File "/localhome/raghu/ipython-0.10/IPython/__init__.py", line 58, in <module>
    __import__(name,glob,loc,[])
  File "/localhome/raghu/ipython-0.10/IPython/Shell.py", line 40, in <module>
    from IPython.iplib import InteractiveShell
  File "/localhome/raghu/ipython-0.10/IPython/iplib.py", line 61, in <module>
    from IPython.Prompts import CachedOutput
  File "/localhome/raghu/ipython-0.10/IPython/Prompts.py", line 69, in <module>
    __PColLightBG  = __PColLinux.copy('LightBG')
  File "/localhome/raghu/ipython-0.10/IPython/ColorANSI.py", line 114, in copy
    return ColorScheme(name,self.colors.__dict__)
  File "/localhome/raghu/ipython-0.10/IPython/ColorANSI.py", line 108,
in __init__
    self.colors = Struct(colordict)
  File "/localhome/raghu/ipython-0.10/IPython/ipstruct.py", line 121,
in __init__
    raise TypeError,\
TypeError: Initialize with a dictionary or key=val pairs.
-----

I tried passing options "-colors NoColor -nocolor_info -noreadline"
but that didn't help. While I try to debug this further, I thought I
would ask here if any one else tried this out. I found an open jython
bug (http://bugs.jython.org/issue1133) but I am not sure if they
(still) apply to 0.10.

Thanks,
Raghu

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: jython and ipython

by Philip Jenvey-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 3, 2009, at 1:39 PM, Raghuram Devarakonda wrote:

> I am trying to run ipython (0.10) using jython built from trunk and I
> get the following error:
>
> -----
> Traceback (most recent call last):
>  File "ipython.py", line 10, in <module>
>    import IPython.Shell
>  File "/localhome/raghu/ipython-0.10/IPython/__init__.py", line 58,  
> in <module>
>    __import__(name,glob,loc,[])
>  File "/localhome/raghu/ipython-0.10/IPython/Shell.py", line 40, in  
> <module>
>    from IPython.iplib import InteractiveShell
>  File "/localhome/raghu/ipython-0.10/IPython/iplib.py", line 61, in  
> <module>
>    from IPython.Prompts import CachedOutput
>  File "/localhome/raghu/ipython-0.10/IPython/Prompts.py", line 69,  
> in <module>
>    __PColLightBG  = __PColLinux.copy('LightBG')
>  File "/localhome/raghu/ipython-0.10/IPython/ColorANSI.py", line  
> 114, in copy
>    return ColorScheme(name,self.colors.__dict__)
>  File "/localhome/raghu/ipython-0.10/IPython/ColorANSI.py", line 108,
> in __init__
>    self.colors = Struct(colordict)
>  File "/localhome/raghu/ipython-0.10/IPython/ipstruct.py", line 121,
> in __init__
>    raise TypeError,\
> TypeError: Initialize with a dictionary or key=val pairs.
> -----
>
> I tried passing options "-colors NoColor -nocolor_info -noreadline"
> but that didn't help. While I try to debug this further, I thought I
> would ask here if any one else tried this out. I found an open jython
> bug (http://bugs.jython.org/issue1133) but I am not sure if they
> (still) apply to 0.10.

I don't know if the patch linked to in the ticket still applies  
cleanly but at least part of it is still relevant. It has a fix for  
the exception you're getting (the patch to ipstruct.py).

--
Philip Jenvey


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: jython and ipython

by Raghuram Devarakonda-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Sep 4, 2009 at 2:41 AM, Philip Jenvey<pjenvey@...> wrote:
>
> I don't know if the patch linked to in the ticket still applies cleanly but
> at least part of it is still relevant. It has a fix for the exception you're
> getting (the patch to ipstruct.py).

Thanks. That patch doesn't cleanly apply any more but I went ahead and
applied it manually. Things seem to work fine with "-noreadline"
option. How ever, when readline is enabled (default), there were some
errors. I got around them by making changes to Jython's readline.py.
Basically, I commented out "__all__" because ipython is doing "from
readline import *". Then, readline.get_completer_delims() is returning
'None' for some reason when it is supposed to return a string. I
looked at libreadline-java's JNI code for getWordBreakCharactersImpl
which does seem to return some string. Any way, I modified
readline.get_completer_delims() to return null string in case of
'None' . This brought me to the next error where ipython is looking
for readline.get_endidx. This is in Python's readline module
implementation (in C) so that is where I stopped.

Thanks,
Raghu

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users