Author jeff.allen
Recipients jeff.allen, stefan.richthofer
Date 2018-04-12.20:22:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Failure in more detail:

    [junit] Testsuite: org.python.core.PySystemStateTest
    [junit] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.313 sec
    [junit] Testcase: testGetJarFileNameFromURL(org.python.core.PySystemStateTest):     FAILED
    [junit] expected:<[/]some_dir/some.jar> but was:<[]some_dir/some.jar>
    [junit] junit.framework.ComparisonFailure: expected:<[/]some_dir/some.jar> but was:<[]some_dir/some.jar>
    [junit]     at org.python.core.PySystemStateTest.testGetJarFileNameFromURL(

There isn't a drive letter involved here, but I appreciate the existence of drive letters invalidates otherwise correct manipulation in a lot of contexts. I've done some of that myself in the code base. (I never made getcwd() work correctly on the D-drive.)

Ideally we would depend on the nice people at Oracle/OpenJDK to get this stuff right. I'd love to re-work all this guff using java.nio.Paths one day. For now, I think is probably the right answer.

>>> from import File
>>> from java.util.jar import JarFile
>>> from import URL
>>> f = File(r"dist\lib\test\blob.jar")
>>> f.getAbsoluteFile()
>>> f.toURI()
>>> j = JarFile(r"dist\lib\test\blob.jar")
>>> list(j.entries())
>>> u = URL("jar:" + str(f.toURI()) + "!/")
>>> u
>>> import os
>>> os.path.relpath(u.getPath().split(':',1)[1].split('!')[0][1:])

To be honest, I've lightly lost the thread of #2386, and why we ended up with this test failure.:/ Does something in the round-trip I just made suggest a simple, cross-platform and correct version of getJarFileNameFromURL or getJarFileName ?
Date User Action Args
2018-04-12 20:22:10jeff.allensetmessageid: <>
2018-04-12 20:22:10jeff.allensetrecipients: + jeff.allen, stefan.richthofer
2018-04-12 20:22:10jeff.allenlinkissue2410 messages
2018-04-12 20:22:09jeff.allencreate