Quantcast

Jython Hangs with Cygwin

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Jython Hangs with Cygwin

David Eisner-2
I'm just getting started with Jython. I installed Jython 2.5.2 on
Vista SP2 32-bit, using Java 1.6.0_24.

When I run jython.bat from a Windows cmd shell it starts up without incident.

However, when I run the jython bash script from a Cgywin (v1.7.9)
shell, it hangs before displaying anything to the terminal.

If I run it with the -v flag, I see this:

$ jython -v
import: 'exceptions' as org.python.core.exceptions in builtin modules
import: import site # precompiled from
C:\Users\username\local\jython2.5.2\Lib\site$py.class
import: 'sys' as sys in builtin modules
import: import os # precompiled from
C:\Users\username\local\jython2.5.2\Lib\os$py.class
import: 'errno' as org.python.modules.errno in builtin modules
import: 'nt' as org.python.modules.posix.PosixModule in builtin modules
import: import ntpath # precompiled from
C:\Users\username\local\jython2.5.2\Lib\ntpath$py.class
import: import stat # precompiled from
C:\Users\username\local\jython2.5.2\Lib\stat$py.class
import: 'java' as java package
import: 'File' as java class
import: 'org' as java package
import: 'Py' as java class
import: import UserDict # precompiled from
C:\Users\username\local\jython2.5.2\Lib\UserDict$py.class
[hangs here]

I ran procmon from sysinternals while starting jython, and this is the
last set of system calls made by the java.exe process:

3:36:17.8762864
PM java.exe 5036 ReadFile C:\Users\username\local\jython2.5.2\jython.jar SUCCESS Offset:
8,044,044, Length: 160
3:36:17.8763935
PM java.exe 5036 ReadFile C:\Users\username\local\jython2.5.2\jython.jar SUCCESS Offset:
4,448,792, Length: 30
3:36:17.8764149
PM java.exe 5036 ReadFile C:\Users\username\local\jython2.5.2\jython.jar SUCCESS Offset:
4,448,869, Length: 1,597

Any ideas about what's going on?

Thanks.

-David

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

Philip Jenvey-3

On Apr 21, 2011, at 12:53 PM, David Eisner wrote:

> I'm just getting started with Jython. I installed Jython 2.5.2 on
> Vista SP2 32-bit, using Java 1.6.0_24.
>
> When I run jython.bat from a Windows cmd shell it starts up without incident.
>
> However, when I run the jython bash script from a Cgywin (v1.7.9)
> shell, it hangs before displaying anything to the terminal.
>
> If I run it with the -v flag, I see this:
>
> $ jython -v
> import: 'exceptions' as org.python.core.exceptions in builtin modules
> import: import site # precompiled from
> C:\Users\username\local\jython2.5.2\Lib\site$py.class
> import: 'sys' as sys in builtin modules
> import: import os # precompiled from
> C:\Users\username\local\jython2.5.2\Lib\os$py.class
> import: 'errno' as org.python.modules.errno in builtin modules
> import: 'nt' as org.python.modules.posix.PosixModule in builtin modules
> import: import ntpath # precompiled from
> C:\Users\username\local\jython2.5.2\Lib\ntpath$py.class
> import: import stat # precompiled from
> C:\Users\username\local\jython2.5.2\Lib\stat$py.class
> import: 'java' as java package
> import: 'File' as java class
> import: 'org' as java package
> import: 'Py' as java class
> import: import UserDict # precompiled from
> C:\Users\username\local\jython2.5.2\Lib\UserDict$py.class
> [hangs here]

It probably hasn't actually hanged, it may just be that the prompt isn't showing up (because interactive mode wasn't detected correctly).

Try running the jython script (for unix platforms) instead of jython.bat, it should have a workaround for this issue. Maybe the .bat file should too but I'm not sure about that.

--
Philip Jenvey


------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

David Eisner-2
On Thu, Apr 21, 2011 at 4:33 PM, Philip Jenvey <[hidden email]> wrote:
> It probably hasn't actually hanged, it may just be that the prompt isn't showing up (because interactive mode wasn't detected correctly).
>
> Try running the jython script (for unix platforms) instead of jython.bat, it should have a workaround for this issue. Maybe the .bat file should too but I'm not sure about that.
>

Actually, I am running the jython bash script in cygwin (see previous
message). I'm only running jython.bat in a Windows cmd shell, where
everything works.  But you're absolutely correct: it isn't hanging,
it's just not showing the prompt, or my input.  If I type '1+1<enter>'
and '7*7<enter>', I see Jython's output, but nothing else:

--snip--
$ head -3 `which jython`
#!/usr/bin/env bash

# This file was generated by the Jython installer

$ jython
2
49
--snip--

So now the question is, why isn't it echoing the prompt, or my input?

Thanks for your help.

-David

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

Dan Stromberg-2

On Thu, Apr 21, 2011 at 1:42 PM, David Eisner <[hidden email]> wrote:
On Thu, Apr 21, 2011 at 4:33 PM, Philip Jenvey <[hidden email]> wrote:
> It probably hasn't actually hanged, it may just be that the prompt isn't showing up (because interactive mode wasn't detected correctly).
>
> Try running the jython script (for unix platforms) instead of jython.bat, it should have a workaround for this issue. Maybe the .bat file should too but I'm not sure about that.
>

Actually, I am running the jython bash script in cygwin (see previous
message). I'm only running jython.bat in a Windows cmd shell, where
everything works.  But you're absolutely correct: it isn't hanging,
it's just not showing the prompt, or my input.  If I type '1+1<enter>'
and '7*7<enter>', I see Jython's output, but nothing else:

--snip--
$ head -3 `which jython`
#!/usr/bin/env bash

# This file was generated by the Jython installer

$ jython
2
49
--snip--

So now the question is, why isn't it echoing the prompt, or my input?

Some Windows applications do console I/O by writing to video RAM directly, instead of *ix's more disciplined approach - which some Windows applications use instead.

Presumably, Jython is one of those that writes directly to video RAM.  For these, you're pretty much stuck with cmd.exe or similar.
 

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

Wizzzard
Am 23.04.2011 00:30, schrieb Dan Stromberg:

>
> On Thu, Apr 21, 2011 at 1:42 PM, David Eisner <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Thu, Apr 21, 2011 at 4:33 PM, Philip Jenvey
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     > It probably hasn't actually hanged, it may just be that the prompt
>     isn't showing up (because interactive mode wasn't detected correctly).
>     >
>     > Try running the jython script (for unix platforms) instead of
>     jython.bat, it should have a workaround for this issue. Maybe the
>     .bat file should too but I'm not sure about that.
>     >
>
>     Actually, I am running the jython bash script in cygwin (see previous
>     message). I'm only running jython.bat in a Windows cmd shell, where
>     everything works.  But you're absolutely correct: it isn't hanging,
>     it's just not showing the prompt, or my input.  If I type '1+1<enter>'
>     and '7*7<enter>', I see Jython's output, but nothing else:
>
>     --snip--
>     $ head -3 `which jython`
>     #!/usr/bin/env bash
>
>     # This file was generated by the Jython installer
>
>     $ jython
>     2
>     49
>     --snip--
>
>     So now the question is, why isn't it echoing the prompt, or my input?
>
>
> Some Windows applications do console I/O by writing to video RAM
> directly, instead of *ix's more disciplined approach - which some
> Windows applications use instead.
>
> Presumably, Jython is one of those that writes directly to video RAM.
> For these, you're pretty much stuck with cmd.exe or similar.

And why did it work before the release of jython2.5.1?

Doing some things a bit different does not mean, there is no solution
for it, and there was once a solution that was cancelled by thinking,
this old beviour is non standard let us drop it. That cygwin users are
annoyed about this obvious wrong solution did not matter.

Regards,
Roland.

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

PencilBoy99
In reply to this post by David Eisner-2
http://python.6.x6.nabble.com/Jython-Hangs-with-Cygwin-td1778354.html

I have the same problem. I'm using 2.7b2. It  works fine from the command prompt.

I downloaded the source and put the jython script in the bin and root directory of jython

When I run the command jython from cygwin, I get the same hang -v prints the list the original poster documented, running jython -i just hangs.

Here's the command it's running that hangs

/cygdrie/e/PortableApps/Java/jdk1.8.0_05/bin/java -Djline.terminal=jline.UnixTerminal -classpath 'E:\PortableApps\jython2.7b2\jython.jar;' -Dpython.home=E:/PortableApps/jython2.7b2 org.python.util.jython -i
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

PencilBoy99
I did some more investigation. Using the standalone jar
- non interactive and interactive mode works from dos
- non interactive and interactive mode works from linux
- non interactive mode works on cygwin but interactive does
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

Jeff Allen-2
A quick search suggests some difficulty exists between JLine and Cygwin,
and also some work-arounds. If that doesn't work for you, you may have
to make do with the PlainConsole
(https://wiki.python.org/jython/ConsoleChoices).

We don't test on Cygwin: maybe we should. Jython presumably thinks it is
running on Windows (os._name is 'nt') because Java does
(sys.registry['os.name'] is u'Windows 7' or whatever). And it is.

Left to itself, I expect JLine will choose a jline.WindowsTerminal. Does
that not work?

Jeff Allen

On 01/08/2014 21:23, PencilBoy99 wrote:

> I did some more investigation. Using the standalone jar
> - non interactive and interactive mode works from dos
> - non interactive and interactive mode works from linux
> - non interactive mode works on cygwin but interactive does
>
>
>
> --
> View this message in context: http://python.6.x6.nabble.com/Jython-Hangs-with-Cygwin-tp1778354p5066191.html
> Sent from the jython-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Jython-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jython-users
>


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

PencilBoy99
Jeff Allen-2 wrote
A quick search suggests some difficulty exists between JLine and Cygwin,
and also some work-arounds. If that doesn't work for you, you may have
to make do with the PlainConsole
(https://wiki.python.org/jython/ConsoleChoices).
Left to itself, I expect JLine will choose a jline.WindowsTerminal. Does
that not work?
Thanks Jeff, but I don't know what I should do. Is there a way of telling jython from cygwin to do something different with JLine?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

PencilBoy99
Sorry. I tried hacking the jython script with different -DConsole settings in the command like (jline, readline). they all hung.


-- gary furash | [hidden email], 520-907-2470 | calendar



On Fri, Aug 8, 2014 at 9:07 AM, PencilBoy99 [via Python] <[hidden email]> wrote:
Jeff Allen-2 wrote
A quick search suggests some difficulty exists between JLine and Cygwin,
and also some work-arounds. If that doesn't work for you, you may have
to make do with the PlainConsole
(https://wiki.python.org/jython/ConsoleChoices).
Left to itself, I expect JLine will choose a jline.WindowsTerminal. Does
that not work?
Thanks Jeff, but I don't know what I should do. Is there a way of telling jython from cygwin to do something different with JLine?



If you reply to this email, your message will be added to the discussion below:
http://python.6.x6.nabble.com/Jython-Hangs-with-Cygwin-tp1778354p5067209.html
To unsubscribe from Jython Hangs with Cygwin, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jython Hangs with Cygwin

Jeff Allen-2
I have now tried some of this myself on Cygwin. When I try this it doesn't actually hang, but it decides (jnr-posix decides) that the terminal is not interactive. You therefore get no sign-on or prompt. There is also no local echo at the terminal. But if I type 6*7, blindly, it answers 42.

As it is not interactive, it chooses a PlainConsole, which means just use Java i/o. No options exist to force Jython to believe it is interactive. If I launch Jython directly as a java command line, I can get it to echo by placing stty echo in front.

$ stty echo; java -cp build\\exposed\;build\\classes\;extlibs\\* -Dpython.home=dist org.python.util.jython
6*7
42
exit()

I'm not sure this command is fully functional, and it's in the development environment, not running the JAR, so you won't be able to copy it directly. What *I* see is already reported as http://bugs.jython.org/issue1669. If that's what you see, then it may help that I've bumped it with a new comment.

Jeff
Jeff Allen
On 08/08/2014 18:29, PencilBoy99 wrote:
Sorry. I tried hacking the jython script with different -DConsole settings in the command like (jline, readline). they all hung.


-- gary furash | [hidden email], 520-907-2470 | calendar



On Fri, Aug 8, 2014 at 9:07 AM, PencilBoy99 [via Python] <[hidden email]> wrote:
Jeff Allen-2 wrote
A quick search suggests some difficulty exists between JLine and Cygwin,
and also some work-arounds. If that doesn't work for you, you may have
to make do with the PlainConsole
(https://wiki.python.org/jython/ConsoleChoices).
Left to itself, I expect JLine will choose a jline.WindowsTerminal. Does
that not work?
Thanks Jeff, but I don't know what I should do. Is there a way of telling jython from cygwin to do something different with JLine?



If you reply to this email, your message will be added to the discussion below:
http://python.6.x6.nabble.com/Jython-Hangs-with-Cygwin-tp1778354p5067209.html
To unsubscribe from Jython Hangs with Cygwin, click here.
NAML



View this message in context: Re: Jython Hangs with Cygwin
Sent from the jython-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds


_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Loading...