Issue1123

classification
Title: Weird "unexpected at this time" error.
Type: Severity: minor
Components: Versions: 2.5alpha1
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: otmarhumbel Nosy List: MrMeanie, astigmatik, fwierzbicki, otmarhumbel
Priority: Keywords:

Created on 2008-09-08.04:51:35 by astigmatik, last changed 2008-09-13.17:04:07 by fwierzbicki.

Files
File name Uploaded Description Edit Remove
1123-patch otmarhumbel, 2008-09-08.14:30:12 Patch for issue 1123
Messages
msg3485 (view) Author: astigmatik (astigmatik) Date: 2008-09-08.04:51:34
This is actually for Jython 2.5 Alpha 2.

On Sun, Sep 7, 2008 at 10:07 PM,  <astigmatik@....> wrote:
> I got this error on WinXP when I tried to run it, pasted verbatim:
>
> Files\Java\jre1.6.0_06"" was unexpected at this time.
>
> So it doesn't work with the new JRE, but at least the error message
> shouldn't have messed up...
msg3486 (view) Author: Oti Humbel (otmarhumbel) Date: 2008-09-08.08:48:41
I tried to reproduce it on Vista, running jre 1.6.0_7.
The installer runs fine.
When calling jython.bat, I got the (German) message:
"Files\Java\jre1.6.0_07""" kann syntaktisch an dieser Stelle nicht
verarbeitet werden.
, which - roughly translated - means that the .bat file has a syntax error.
REMing all the @echo off statemtents, I get the following output just
before the error:

C:\jython2.5a2>setlocal enabledelayedexpansion
C:\jython2.5a2>rem ----- Verify and set required environment variables --
C:\jython2.5a2>set _JAVA_CMD=java
"Files\Java\jre1.6.0_07""" kann syntaktisch an dieser Stelle nicht
verarbeitet werden.
C:\jython2.5a2>if not ""C:\Program Files\Java\jre1.6.0_07"" == "" (
C:\jython2.5a2>

Now I'm not too much a .bat file expert, but I'll poke around with it a bit.
And I am pretty sure that is NOT an issue with a newer jre:
If I switch to jre1.5.0_15, the error message is exactly the same.
msg3487 (view) Author: Oti Humbel (otmarhumbel) Date: 2008-09-08.08:59:07
replacing
  if not "%JAVA_HOME%" == "" (
with
  if not %JAVA_HOME% == "" (
in jython.bat solves the problem.
I have to find out how installer and jython.bat interact to be able to
fix it.
msg3488 (view) Author: Oti Humbel (otmarhumbel) Date: 2008-09-08.12:35:34
OK, got the /bin/jython.bat and readFromFile() trick in
StartScriptGenerator.
Further experimenting with [%JAVA_HOME%] == [""] syntax.
For a real hard core test, I'll install into a directory containing a
blank. This will probably reveal the robustness of JYTHON_HOME.
msg3489 (view) Author: Oti Humbel (otmarhumbel) Date: 2008-09-08.14:30:12
The attached patch IMHO fixes the problem.
I manually replaced the patched jython.bat file in
jython_installer-2.5a2.jar and ran a bunch of tests:

a) installation into a directory containing no spaces (blanks):
   successful (like before)

b) installation into a directory containing a space (blank):
   successful (like before)

c) starting jython from the directory without spaces:
   successful

d) starting jython from the directory containing a space:
   successful

In addition, I tried to start jython by calling /bin/jython.bat.
The following table shows success in all combinations of set/unset
JAVA_HOME and JYTHON_HOME environment variables:

JAVA_HOME | JYTHON_HOME |  install dir   | calling /bin/jython.bat
 is set   |   is set    | contains space |     is successful
----------+-------------+----------------+------------------------
    N     |     N       |       N        |         yes
    N     |     Y       |       N        |         yes
    Y     |     N       |       N        |         yes
    Y     |     Y       |       N        |         yes
    N     |     N       |       Y        |         yes
    N     |     Y       |       Y        |         yes
    Y     |     N       |       Y        |         yes
    Y     |     Y       |       Y        |         yes
----------+-------------+----------------+------------------------
msg3490 (view) Author: Oti Humbel (otmarhumbel) Date: 2008-09-08.14:47:18
http://jython.svn.sourceforge.net/viewvc/jython?view=rev&revision=5302
fixes this on trunk.
Now I am not quite sure how to get this into alpha 2.
msg3496 (view) Author: Geoffrey French (MrMeanie) Date: 2008-09-10.07:59:41
I am running Vista, and this problem still occurs when you supply an
argument (a python file to run in my case). I get the message:

\Java\jre1.6.0_06\lib\ext\QTJava.zip was unexpected at this time.

I fixed it by changing:

if ["%_CMP%"] == ["--verify"] (
   set CLASSPATH=%_CP:"=%;%CLASSPATH:"=%
   set _CP=
   goto :nextArg
)


to:



if ["%_CMP%"] == ["--verify"] (
   set CLASSPATH=\"%_CP:"=%;%CLASSPATH:"=%\"
   set _CP=
   goto :nextArg
)
msg3508 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-09-13.17:04:07
Fixed as of alpha3
History
Date User Action Args
2008-09-13 17:04:07fwierzbickisetstatus: open -> closed
nosy: + fwierzbicki
resolution: fixed
messages: + msg3508
2008-09-10 07:59:42MrMeaniesetnosy: + MrMeanie
messages: + msg3496
2008-09-08 14:47:18otmarhumbelsetmessages: + msg3490
2008-09-08 14:30:13otmarhumbelsetfiles: + 1123-patch
messages: + msg3489
2008-09-08 12:35:35otmarhumbelsetmessages: + msg3488
2008-09-08 08:59:08otmarhumbelsetassignee: otmarhumbel
messages: + msg3487
2008-09-08 08:48:42otmarhumbelsetnosy: + otmarhumbel
messages: + msg3486
2008-09-08 04:51:35astigmatikcreate