Title: findResource(s) for SyspathJavaLoader
Type: rfe Severity: normal
Components: Core Versions: Jython 2.7, Jython 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, gthank, jflatow, rec, zyasoft
Priority: normal Keywords: patch

Created on 2008-02-18.15:43:34 by jflatow, last changed 2014-05-21.20:49:38 by zyasoft.

File name Uploaded Description Edit Remove
expanded_classloader.patch jflatow, 2008-02-18.15:43:35 The patch itself
patch-issue-1896215-rec-20140324.diff rec, 2014-03-24.15:21:12 Adds findResources() method to SyspathJavaLoader
msg2989 (view) Author: Jared (jflatow) Date: 2008-02-18.15:43:34
The SyspathJavaLoader classloader does not implement findResource methods, this patch is an attempt to add such behavior. I have also attempted to define the package appropriately when a class is loaded (as per the GNU Java ClassLoader implementation). I believe there are some additional problems with the current implementation of the classloader (e.g. loadClass should be findClass), however I have not changed this here. Also, the Thread's contextClassLoader should probably at some point get set to this ClassLoader.

The implementation I am providing solved the problem for me of loading a Spring application context (ClassPathXmlApplicationContext) from the Jython shell.

msg7370 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-08-10.19:54:58
Hi jflatow, sorry this has lingered so long. Is there any chance that you could provide some kind of test code?
msg8258 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-03-21.19:39:59
I also stumbled other this issue today in Jython 2.5.4rc 1 (respectively in HEAD). My fix was a smaller modification than what is provided in the present patch but generally goes in the same direction: the findResource() code can be copied and modified minimally so that the "return" statements actually add the URLs to a collection which is then returned as an enumeration. I also had to fix this because I am using Spring's classpath-scanning functionality. It would be most excellent if this could be included with the official sources. It is such a trivial addition that I believe it should be reasonable to add it without specific test cases. If you can point me to a test case that tests the findResource() method of SyspathJavaLoader I could possibly create a modified version for testing findResources()
msg8259 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-03-21.19:44:31
Make that Jython 2.7beta 1 (respective HEAD)
msg8263 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-03-24.15:21:12
Added patch against current Jython 2.7beta branch. Looks like this patch is more minimalistic than the previous patch attached here in 2008.
msg8266 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-03-30.17:32:07
Hi Rich - maybe if you included instructions to hand test the patch I could just verify,code review, and accept - I'm long overdue on getting this closed. Thanks!
msg8267 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-03-30.20:39:42
To test if the patch works, try any of the scripts on the following page with and without a patched Jython version:
msg8268 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-03-30.22:28:04
Cool, I'm out of town for the next week with (probably) poor connectivity - but if nothing happens here for > 10 days make another comment and it will show up in my email and prompt me to finish this off. Thanks again!
msg8283 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-04-11.06:34:33
10 days have passed - here is the reminder: *ping* :)
msg8284 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-04-11.22:35:14
Thanks for the ping - sorry the day job has me swamped - and into the weekend this time (not that common but it happens sometimes). I will try to get it looked at over the weekend.
msg8285 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-04-14.07:24:30
Bleh - sorry - day job has definitely done me in for the weekend and a bit to come. If you don't see anything happen for another week please ping again :(
msg8297 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-04-22.16:48:30
Hi Rich - this patch looks good to me - I forgot to ask though: would you mind signing a contributor agreement and let me know your full name so I can put you in the ACKNOWLEDGEMENTS file? The contributor agreement is a web based form here: -- you need a username at ("python" not "jython") to complete it.
msg8298 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-04-22.20:35:13
I didn't expect a CLA to be necessary for a patch that trivial ;) But sure, I'll get the process done and drop you a note afterwards.
msg8303 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-04-24.13:02:49
Frank, the PDF download of the CLA does not seem to work.

I also did not find out how you handle CLAs from individuals that are under contract. As I understand it, I can neither sign the agreement myself nor on behalf of my organization. I can ask my boss to sign an agreement, but my boss would not have a username on the bugtracker. How can we handle that?
msg8304 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-04-24.14:01:46
IANAL - but I think if you did the work on your own time then it's still you that signs the CLA. If you wrote the code for them, or the terms of the contract require it, a representative of the company can sign - I've had two companies do that now - so I can give details when we track down that PDF. I'm finding out why the PDF link is dead - probably it didn't get updated in the transition to the new website.
msg8306 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-04-24.15:32:52
The PDF version is here:

BTW - looking at the PSF CLA FAQ -- that's a lot of acronyms :) -- I see this:

If the contributor is an employee, then the company should sign the contributor agreement unless (1) the company authorized the employee to make the contribution under his/her own name, or (2) the employee's contribution was independently created outside the scope of his employment.

So it looks like they could just "authorize" you.
msg8312 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-04-28.10:38:21
Thanks for the pointers. I think filling in the form (PDF) and submitting that is the easiest option. The form has two sections that mention a "contributor", one in the upper part where I would also record the username, the other for signing. Is it correct to enter my name in the upper part and my bosses name in the lower part where my boss then would also sign?
msg8313 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-04-29.04:10:36
Hi Richard,

The form is a little confusing. Since the contributor is a company there is no need for your signature or name, only the representative of the company. You could probably leave "organization" blank since the contributor is the company but I would just repeat the company name. I would do this:

* Make sure to check the box about signing on the behalf of an organization.

Contributor: company name username: your username at
Organization: company name
Address: company address
email: your boss's email

Initial license: Apache License version 2.0

Leave the PSF section blank

Contributor section:

Name: boss's name
Signature: boss's signature
Date: today's date
Title: boss's title

That's how my boss did it in my current job - though back when he signed there was no "organization" line.
msg8346 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-05-08.08:15:26
CLA submitted. Awaiting confirmation.
msg8382 (view) Author: Richard Eckart de Castilho (rec) Date: 2014-05-12.13:17:04
Received confirmation that the CLA has been registered on the Python bug tracker account.

Anything else that needs to be done?
msg8390 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2014-05-13.14:36:45
That's everything! I'll be sure to get this in today.
msg8391 (view) Author: Hank Gay (gthank) Date: 2014-05-13.18:43:07
Target beta 4.
msg8470 (view) Author: Jim Baker (zyasoft) Date: 2014-05-21.20:49:38
Fixed in beta 3
Date User Action Args
2014-05-21 20:49:38zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg8470
nosy: + zyasoft
2014-05-13 18:43:07gthanksetnosy: + gthank
messages: + msg8391
2014-05-13 14:36:46fwierzbickisetmessages: + msg8390
2014-05-12 13:17:04recsetmessages: + msg8382
2014-05-08 08:15:26recsetmessages: + msg8346
2014-04-29 04:10:37fwierzbickisetmessages: + msg8313
2014-04-28 10:38:22recsetmessages: + msg8312
2014-04-24 15:32:52fwierzbickisetmessages: + msg8306
2014-04-24 14:01:46fwierzbickisetmessages: + msg8304
2014-04-24 13:02:49recsetmessages: + msg8303
2014-04-22 20:35:13recsetmessages: + msg8298
2014-04-22 16:48:31fwierzbickisetmessages: + msg8297
2014-04-14 07:24:30fwierzbickisetmessages: + msg8285
2014-04-11 22:35:15fwierzbickisetmessages: + msg8284
2014-04-11 06:34:33recsetmessages: + msg8283
2014-03-30 22:28:04fwierzbickisetmessages: + msg8268
2014-03-30 20:39:42recsetmessages: + msg8267
2014-03-30 17:32:07fwierzbickisetmessages: + msg8266
2014-03-30 17:31:54fwierzbickisetmessages: - msg8265
2014-03-30 17:31:37fwierzbickisetmessages: + msg8265
2014-03-24 15:22:03recsettype: rfe
2014-03-24 15:21:13recsetfiles: + patch-issue-1896215-rec-20140324.diff
messages: + msg8263
2014-03-21 19:49:42recsetversions: + Jython 2.7
2014-03-21 19:44:31recsetmessages: + msg8259
2014-03-21 19:40:00recsetnosy: + rec
messages: + msg8258
2013-02-25 18:50:52fwierzbickisetversions: + Jython 2.5, - 2.5.1
2012-08-10 19:54:58fwierzbickisetassignee: fwierzbicki
messages: + msg7370
2009-03-30 17:06:07fwierzbickisetassignee: fwierzbicki -> (no value)
2009-03-30 16:43:26fwierzbickisetversions: + 2.5.1
2009-03-14 02:58:13fwierzbickisetassignee: fwierzbicki
nosy: + fwierzbicki
2008-12-15 16:02:58fwierzbickisetcomponents: + Core, - None
2008-02-18 15:43:34jflatowcreate