Issue2388

classification
Title: jython.exe crashes for me on Windows 7, 64 bit
Type: Severity: normal
Components: Any Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen, stefan.richthofer, zyasoft
Priority: Keywords:

Created on 2015-09-02.23:03:16 by stefan.richthofer, last changed 2015-09-04.11:54:33 by stefan.richthofer.

Messages
msg10208 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-02.23:03:16
On my system jython.exe crashes with the following message:

D:\workspace\eclipseWorkspace\jython>dist\bin\jython.exe
Traceback (most recent call last):
  File "<string>", line 444, in <module>
  File "<string>", line 435, in main
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 522, in call
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 710, in __init__
  File "Z:\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

D:\workspace\eclipseWorkspace\jython>

"Das System kann die angegebene Datei nicht finden" is "System cannot find the declared file" in english. Any hints on this? Maybe it is not a bug, in this case view this as issue-discussion.
Note that there is no CPython installed on that system, but that shouldn't cause problems, should it? Maybe it cannot find MSVCRT.dll or something?
msg10209 (view) Author: Jim Baker (zyasoft) Date: 2015-09-02.23:32:18
PyInstaller bundles CPython on Windows. Looks like we need to distribute MSVCRT.dll as well - presumably no issues with licensing, but to be determined.

See http://stackoverflow.com/questions/1073509/should-i-redistribute-msvcrt-dll-with-my-application
msg10210 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-02.23:49:50
If this error really originates from missing MSVCRT.dll...
I will check, whether this error can be cured by providing CPython's MSVCRT.dll.

Note that Java also ships with an MSVCRT.dll, but with a newer one than CPython, which is not compatible afaik. And we probably cannot compile the launcher against Java's MSVCRT.dll (but I plan to do that for LiJy-Launch).
msg10211 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-03.10:54:49
I tried to provide msvcrt.dll, but were not able to improve the situation, so maybe this isn't actually the cause. Some questions came up:

My attempt was to get the msvcrt I assumed was bundeled with Python 2.7. I found out that Python 2.7 for Windows is only available as .msi file and I failed to unpack the archive on linux with several programs ("unsupported archive"), which is strange, because it is usually no problem to read .msi files.

So I just installed the .msi on windows, which went fine. However there is no msvcrt.dll in the Python folder. Maybe it was installed to a system folder, but I have no clue to which - there is an msvcrt.dll in System32, but that might have been there before.

I also took a look at Python 3, which is also available as zip-archive for windows, but again - no masvcrt or similar is in that archive. So it appears that msvcrt is actually *not* bundeled with Python.

Then I asked google and found out that Python 2.7 is said to be linked against msvcr90.dll - good to know the actual version. However there are plaenty of these files on my windows partition in several locations, but none of them is in a general system-folder or a Python-related folder. They are in some update-cache-folders, mainly in winssx.

I chose one and copied it to Jython-bin folder next to jython.exe, but this didn't change anything. I tried this with a version of the file from a 64-bit-sounding folder (x86-amd64 in the name) as well as with one from a 32-bit-sounding folder (just x86 in the name).

Any ideas what else to try? Would also be good to know how Python's access to msvcr90.dll really works.

1) Does it actually really need it?
2) If so, why does it (seemingly) not supply it?
3) If 1) and 2), how does it work then?
4) Where is msvcr90.dll expected to be stored?
msg10213 (view) Author: Jeff Allen (jeff.allen) Date: 2015-09-03.20:12:54
I run Jython all the time on Win7-64 (auf Englisch, selbsverständlich). The message that the system "cannot find the specified file" has come up quite a bit when trying to launch a subprocess, typically when I've been writing or fixing tests, and the file in question is often the Jython executable.

The details escape me, but I would look for problems with the path or the working directory that the subprocess inherits (or doesn't inherit, more to the point). It can be as simple as issuing a cmd.exe built-in command for which no executable exists (to which the solution is to use shell=True, ISTR).

Surely it wouldn't get this far if mscvrt were actually missing?
msg10217 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-03.21:54:11
Okay, thanks for the hint.
I tried to call jython.exe from various places, but always this error. The calling position is the working directory, isn't it? Is there some other way some path could be provided? Just calling jython.exe should start the live console I suppose.
I also tried this after using the official installer as well as on a self-built Jython (building was done on linux).
msg10218 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-03.21:58:48
Okay, sorry - it seems this is a duplicate of Issue2346. I should have looked more carefully before opening it.
msg10228 (view) Author: Jeff Allen (jeff.allen) Date: 2015-09-04.05:16:03
Ah, I see. The trace is from CPython, within jython.exe, and I suppose the missing file to be the java executable (hence the reference to JAVA_HOME in #2346).
msg10230 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-04.11:53:06
I also commented on this at #2346:
This issue also occurs, if JAVA_HOME is not set at all, which is the default situation (!) after "just installing Java".
In combination with the almost useless error-message this is a must-fix for 2.7.1.
msg10231 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2015-09-04.11:54:33
So I close this issue now as a duplicate of #2346. Let's shif potential further discussion to there.
History
Date User Action Args
2015-09-04 11:54:33stefan.richthofersetstatus: open -> closed
resolution: duplicate
messages: + msg10231
2015-09-04 11:53:06stefan.richthofersetmessages: + msg10230
2015-09-04 05:16:03jeff.allensetmessages: + msg10228
2015-09-03 21:58:48stefan.richthofersetmessages: + msg10218
2015-09-03 21:54:11stefan.richthofersetmessages: + msg10217
2015-09-03 20:12:54jeff.allensetnosy: + jeff.allen
messages: + msg10213
2015-09-03 10:54:50stefan.richthofersetmessages: + msg10211
2015-09-02 23:49:50stefan.richthofersetmessages: + msg10210
2015-09-02 23:32:19zyasoftsetmessages: + msg10209
2015-09-02 23:04:06stefan.richthofersetnosy: + zyasoft
components: + Any
versions: + Jython 2.7
2015-09-02 23:03:16stefan.richthofercreate