Issue2860
Created on 2020-02-07.13:37:04 by gbach, last changed 2020-02-11.22:34:00 by jeff.allen.
msg12978 (view) |
Author: Gunter (gbach) |
Date: 2020-02-07.13:37:04 |
|
For some imports like this
from javax.xml.parsers import *
not all names are imported.
With jython 2.7.1 it worked and
DocumentBuilderFactory
was available.
With jython2.7.2 it is not in my context.
I will try to add code to reproduce since on the REPL this works fine in 2.7.2
|
msg12980 (view) |
Author: Jeff Allen (jeff.allen) |
Date: 2020-02-08.10:37:18 |
|
The fact it works in the REPL suggest we may still be dealing with a publication problem, at least if concurrency is involved.
Is this 2.7.2b3?
The other reason for missing classes might be a bug in the package cache. Giving one or more -v options to org.python.util.jython will tell you where it is looking for things, and if different in the REPL from the script, would provide perhaps the best clue.
|
msg12982 (view) |
Author: Gunter (gbach) |
Date: 2020-02-11.08:03:49 |
|
Unfortunately the issue is not limited to "*"-imports.
Now I got some errors (Web-portal using Tomcat) like this:
from datetime import datetime
print datetime.now()
-> Attribute-Error datetime has no attribute "now"
I am using jython 2.7.2b2
|
msg12984 (view) |
Author: Jeff Allen (jeff.allen) |
Date: 2020-02-11.22:34:00 |
|
I'm not able to reproduce this.
PS 272b2-trial> inst\bin\jython -V
Jython 2.7.2b2
PS 272b2-trial> inst\bin\jython -c "from javax.xml.parsers import *; print DocumentBuilderFactory"
<type 'javax.xml.parsers.DocumentBuilderFactory'>
PS 272b2-trial> inst\bin\jython -c "from datetime import datetime; print datetime.now()"
2020-02-11 22:07:35.740000
PS 272b2-trial> inst\bin\jython -c "from datetime import datetime; print len(dir(datetime))"
79
This last is the same as in the REPL. But it sounds like #2834, especially if we are in a servlet context (therefore possibly concurrent).
Could you try on 2.7.2b3 ?
|
|
Date |
User |
Action |
Args |
2020-02-11 22:34:00 | jeff.allen | set | messages:
+ msg12984 |
2020-02-11 08:03:49 | gbach | set | messages:
+ msg12982 |
2020-02-08 10:37:19 | jeff.allen | set | priority: normal type: behaviour messages:
+ msg12980 nosy:
+ jeff.allen |
2020-02-07 13:37:04 | gbach | create | |
|