I debugged a bit in the meantime on this issue.

For reference see the source code at
http://code.google.com/p/robotframework/source/browse/#svn/trunk/src/robot

that 'robot' module has a module 'common' which has the file model.py:

http://code.google.com/p/robotframework/source/browse/trunk/src/robot/common/model.py

this has an import statement at line 16:

import random

The classloader is then asked to to resolve "robot/common/random/__init__$py.class", followed by "robot/common/random/__init__.py", "robot/common/random$py.class" and "robot/common/random.py"

The URL class loader is not asked for "Lib/random.py" or it's $py.class file. which would match with the one in the jython standalone file (I have tested finding it with this string). Is this a bug in the Jython resolver or should I tell the people from the robotframework to use a different way to import it? (If the is one - my python knowledge is not much better than my knowledge of the Human Genome Project - I know it exists and what they try to do.)

Cheers,
Kai

2010/3/4 Kai Hackemesser <kai.hackemesser@gmail.com>
I haven't got any input on that issue in the last days, any help appreciated...

Cheers,
Kai

2010/2/26 Kai Hackemesser <kai.hackemesser@gmail.com>

Hi,

The content of the robotJar jar looks like:

\-robot
\-SeleniumLibrary
- __run__.py

where robot and SeleniumLibrary are python module folders normally found unter Lib/site-packages (the robot framework I mentioned earlier)

The module is detected correctly, but the imported Lib module 'random' is not found (but the imported 'os' module was found before):


Traceback (most recent call last):
  File "__pyclasspath__/__run__.py", line 308, in <module>
  File "__pyclasspath__/robot/__init__.py", line 24, in <module>
  File "__pyclasspath__/robot/output/__init__$py.class", line 16, in <module>
  File "__pyclasspath__/robot/output/output$py.class", line 18, in <module>
  File "__pyclasspath__/robot/common/__init__$py.class", line 16, in <module>
  File "__pyclasspath__/robot/common/model$py.class", line 16, in <module>
ImportError: No module named random

Cheers,
Kai

2010/2/26 Frank Wierzbicki <fwierzbicki@gmail.com>

On Wed, Feb 24, 2010 at 11:04 PM, Kai Hackemesser
<kai.hackemesser@gmail.com> wrote:

>       URL robotURL = robotJar.toURI().toURL();
What are the contents of robotJar?  I think that Jython's normal
classloader isn't kicking in and the Lib/ directory isn't being found,
but it will help if I can give it a try locally.

-Frank