Issue2297

classification
Title: 2.7rc1 installer fails on generating jython.bat under windows
Type: behaviour Severity: critical
Components: Installer Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: Each, fwierzbicki, r_walter, zyasoft
Priority: urgent Keywords:

Created on 2015-03-26.13:06:22 by Each, last changed 2015-04-10.01:55:03 by zyasoft.

Messages
msg9703 (view) Author: Aleksei Kulakov (Each) Date: 2015-03-26.13:06:21
Exception in thread "Thread-10" org.python.util.install.InstallerException: Error accessing jar file
        at org.python.util.install.JarInstaller.inflate(JarInstaller.java:168)
        at org.python.util.install.ProgressPage.activate(ProgressPage.java:84)
        at org.python.util.install.AbstractWizardPage.doActivate(AbstractWizardPage.java:41)
        at org.python.util.install.AbstractWizard.showActivePage(AbstractWizard.java:414)
        at org.python.util.install.AbstractWizard.next(AbstractWizard.java:319)
        at org.python.util.install.AbstractWizard.gotoNextPage(AbstractWizard.java:215)
        at org.python.util.install.AbstractWizardValidator.fireValidationSucceeded(AbstractWizardValidator.java:78)
        at org.python.util.install.AbstractWizardValidator.access$100(AbstractWizardValidator.java:6)
        at org.python.util.install.AbstractWizardValidator$ValidatorThread.run(AbstractWizardValidator.java:16)
Caused by: java.io.FileNotFoundException: C:\Java\Jython\jython.bat (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileReader.<init>(FileReader.java:72)
        at org.python.util.install.FileHelper.readAll(FileHelper.java:72)
        at org.python.util.install.StartScriptGenerator.readFromFile(StartScriptGenerator.java:223)
        at org.python.util.install.StartScriptGenerator.getJythonScript(StartScriptGenerator.java:107)
        at org.python.util.install.StartScriptGenerator.generateStartScripts(StartScriptGenerator.java:88)
        at org.python.util.install.JarInstaller.inflate(JarInstaller.java:146)
        ... 8 more
msg9704 (view) Author: Jim Baker (zyasoft) Date: 2015-03-26.15:02:19
Interesting, we have Windows specific logic in the installer. Looks like we will need an RC2. Too bad no one tried this on Windows when it was a soft release! :)

The problem is simple: there's no longer a jython.bat, it has been replaced by jython.exe. I guess we can use this as an excuse to also move bin/jython.py to bin/jython if CPython is available on Unix-like systems. The other installer fix that I had postponed to 2.7.1 was running ensurepip by default.

I'm on vacation through the end of this week, but I will take a look at this fix when I get back.
msg9705 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2015-03-26.15:39:45
Well that's too bad. I haven't officially announced RC1 yet, though it is irreversibly in maven now. Do you know of a workaround I can put in my rc1 announcement (as in copy jython.exe to... and it should work)?
msg9706 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2015-03-26.15:40:50
I would come up with one myself, but I don't have a windows machine anywhere :)
msg9707 (view) Author: Jim Baker (zyasoft) Date: 2015-03-26.15:46:38
Frank, as a Python committer you can get a MSDN license, so that would solve access for testing. On the other hand, my experience of running Windows 8.1 under a VM is just painful, because of assumptions like touch support or any switching away to the VM restores the tile start screen.
msg9708 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2015-03-26.15:51:10
Jim,

That's a fair point, and it seems that every time I get bitten like this it's windows. I'll see about setting something up so I can at least sanity check windows before rc2.
msg9709 (view) Author: Aleksei Kulakov (Each) Date: 2015-03-26.17:06:53
This error does no harm to installation, it would be fine if user just close installer at that point.

BTW there are couple of other windows/PyInstaller related bugs, i will report them separately
msg9710 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2015-03-26.17:41:57
Aleksei: Jut to be clear: what you see is a frozen installer and an error message, but once you close the installer everything works fine?
msg9711 (view) Author: Aleksei Kulakov (Each) Date: 2015-03-26.17:46:17
Frank: yes, ie i can successfully run jython -m ensurepip
msg9714 (view) Author: Jim Baker (zyasoft) Date: 2015-03-26.21:41:21
I'm glad to hear that it's not completely broken on Windows. We will fix the other bug (#2298) as well in RC2.
msg9715 (view) Author: Jim Baker (zyasoft) Date: 2015-03-26.21:50:41
Blocks RC2
msg9736 (view) Author: Roland Walter (r_walter) Date: 2015-03-30.08:31:35
I cannot verify that jython does work on windows at all.

Just calling jython.exe and I get:

C:\bin>C:\jython2.7rc1\bin\jython.exe
Traceback (most recent call last):
  File "<string>", line 322, in <module>
  File "<string>", line 313, in main
  File "c:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 522, in call
  File "c:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 710, in __init__
  File "c:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 958, in _execute_child
WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
msg9737 (view) Author: Jim Baker (zyasoft) Date: 2015-03-30.18:54:49
Roland, thanks for your feedback. Would you be interested in testing an the preview (or soft) release of RC2 when it's available, presumably in the next couple of days? That would be very helpful!
msg9740 (view) Author: Roland Walter (r_walter) Date: 2015-03-30.21:43:48
I can do this!
msg9748 (view) Author: Jim Baker (zyasoft) Date: 2015-04-01.19:32:34
Fixed as of https://hg.python.org/jython/rev/2056e662a1c6
msg9754 (view) Author: Jim Baker (zyasoft) Date: 2015-04-05.14:36:58
Roland, Alesksei - Please try the first build of RC2 - http://sourceforge.net/p/jython/mailman/message/33715614/ - and see if this fixes this issue for you. Thanks!
msg9755 (view) Author: Roland Walter (r_walter) Date: 2015-04-05.16:06:51
The installer works flawlessly but the result is still not usable. There seems to be something hardcoded in jython.exe that must not be. Here the output when just calling jython.exe:

C:\jython2.7rc2\bin>jython
Traceback (most recent call last):
  File "<string>", line 352, in <module>
  File "<string>", line 343, in main
  File "c:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 522, in call
  File "c:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 710, in __init__
  File "c:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 958, in _execute_child
WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
msg9761 (view) Author: Jim Baker (zyasoft) Date: 2015-04-06.14:04:34
Roland, please try doing

jython --print

and report the results here. The failure is in the attempt to launch java with the the appropriate settings to run Jython using the subprocess module. So for example, here's what it reports on my Windows 8.1 VM:

c:\jython2.7rc2>bin\jython.exe --print
"C:\Program Files\Java\jdk1.7.0_55\bin\java" -Xmx512m -Xss1024k -classpath c:\jython2.7rc2\jython.jar -Dpython.home=c:\jython2.7rc2 -Dpython.executabl
e=c:\jython2.7rc2\bin\jython.exe -Dpython.launcher.uname=windows -Dpython.launcher.tty=true org.python.util.jython

Notably i should be able to directly run the above command line from the Windows prompt, and it should work.
msg9762 (view) Author: Roland Walter (r_walter) Date: 2015-04-06.14:47:49
I removed jython2.5.3+ from the path and unset JYTHON_HOME. With this it works now.
msg9763 (view) Author: Jim Baker (zyasoft) Date: 2015-04-06.14:53:30
Roland, thanks for the testing and quick resolution! Sounds also like an item that should be in the release notes.
msg9764 (view) Author: Jim Baker (zyasoft) Date: 2015-04-06.15:57:06
Aleksei, have you been able to try out the latest soft release? I would like to close out this bug.
History
Date User Action Args
2015-04-10 01:55:03zyasoftsetstatus: pending -> closed
2015-04-06 15:57:06zyasoftsetmessages: + msg9764
2015-04-06 14:53:30zyasoftsetmessages: + msg9763
2015-04-06 14:47:49r_waltersetmessages: + msg9762
2015-04-06 14:04:35zyasoftsetmessages: + msg9761
2015-04-05 16:06:52r_waltersetmessages: + msg9755
2015-04-05 14:36:58zyasoftsetmessages: + msg9754
2015-04-01 19:32:34zyasoftsetstatus: open -> pending
resolution: accepted -> fixed
messages: + msg9748
2015-03-30 21:43:48r_waltersetmessages: + msg9740
2015-03-30 18:54:49zyasoftsetmessages: + msg9737
2015-03-30 08:31:35r_waltersetnosy: + r_walter
messages: + msg9736
2015-03-26 21:50:41zyasoftsetresolution: accepted
messages: + msg9715
2015-03-26 21:41:21zyasoftsetmessages: + msg9714
2015-03-26 17:46:18Eachsetmessages: + msg9711
2015-03-26 17:41:57fwierzbickisetmessages: + msg9710
2015-03-26 17:06:53Eachsetmessages: + msg9709
2015-03-26 15:51:10fwierzbickisetmessages: + msg9708
2015-03-26 15:46:39zyasoftsetmessages: + msg9707
2015-03-26 15:40:50fwierzbickisetmessages: + msg9706
2015-03-26 15:39:45fwierzbickisetmessages: + msg9705
2015-03-26 15:02:20zyasoftsetpriority: urgent
assignee: zyasoft
messages: + msg9704
nosy: + fwierzbicki, zyasoft
2015-03-26 13:10:55Eachsettitle: 2.7rc1 installer fails on generating staring script(jython.bat) under windows -> 2.7rc1 installer fails on generating jython.bat under windows
2015-03-26 13:06:22Eachcreate