Message12058

Author jeff.allen
Recipients jeff.allen, otmarhumbel, stefan.richthofer
Date 2018-07-18.05:45:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531892752.71.0.56676864532.issue2410@psf.upfronthosting.co.za>
In-reply-to
Content
@Stefan: Ah sorry. It takes no time for me:
>>> import os, sys
>>> os.path.dirname(os.path.realpath(sys.executable))
'C:\\Users\\Jeff\\Documents\\Eclipse\\jython-trunk\\dist\\bin'
Works ok.

I know you worked on this to get distutils working. I'll check as well as I can I haven't broken it again, but if you spot me doing something that does, please say.

In response to the question, I beefed up the test to include URLs like jar:file:\C:\some\jy.jar!\A.class, and it passed (gives C:\some\jy.jar).

Then I threw in a couple of UNC paths for good measure, but here it failed. This seems to be a "won't fix" bug in Java. I have worked around it, but there may be no point because Jython simply does not work from a UNC path. :( This is because of a disagreement internal to java.net.URLClassLoader.getResourceAsStream(String name) about the acceptable form of a URL that bites us as soon as we try to read version.properties. The URL produced by java.lang.ClassLoader.getResource(String name) is rejected by java.net.URLConnection.getInputStream(). As far as I can find out, Java has embedded some early interpretation of the URL idea that is now contrary to standards it follows elsewhere, and (surprisingly) has not found its way out of the muddle.
History
Date User Action Args
2018-07-18 05:45:52jeff.allensetmessageid: <1531892752.71.0.56676864532.issue2410@psf.upfronthosting.co.za>
2018-07-18 05:45:52jeff.allensetrecipients: + jeff.allen, otmarhumbel, stefan.richthofer
2018-07-18 05:45:52jeff.allenlinkissue2410 messages
2018-07-18 05:45:50jeff.allencreate