You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(38) |
Nov
(98) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(114) |
Feb
(123) |
Mar
(96) |
Apr
(66) |
May
(84) |
Jun
(72) |
Jul
(128) |
Aug
(126) |
Sep
(82) |
Oct
(80) |
Nov
(148) |
Dec
(55) |
| 2002 |
Jan
(137) |
Feb
(85) |
Mar
(118) |
Apr
(67) |
May
(71) |
Jun
(28) |
Jul
(69) |
Aug
(48) |
Sep
(83) |
Oct
(79) |
Nov
(54) |
Dec
(32) |
| 2003 |
Jan
(44) |
Feb
(47) |
Mar
(59) |
Apr
(57) |
May
(43) |
Jun
(45) |
Jul
(44) |
Aug
(39) |
Sep
(27) |
Oct
(62) |
Nov
(17) |
Dec
(23) |
| 2004 |
Jan
(41) |
Feb
(51) |
Mar
(38) |
Apr
(30) |
May
(25) |
Jun
(12) |
Jul
(11) |
Aug
(27) |
Sep
(16) |
Oct
(56) |
Nov
(23) |
Dec
(29) |
| 2005 |
Jan
(75) |
Feb
(82) |
Mar
(50) |
Apr
(77) |
May
(19) |
Jun
(104) |
Jul
(47) |
Aug
(42) |
Sep
(28) |
Oct
(143) |
Nov
(62) |
Dec
(13) |
| 2006 |
Jan
(20) |
Feb
(10) |
Mar
(59) |
Apr
(45) |
May
(25) |
Jun
(129) |
Jul
(162) |
Aug
(91) |
Sep
(15) |
Oct
(39) |
Nov
(186) |
Dec
(191) |
| 2007 |
Jan
(134) |
Feb
(140) |
Mar
(106) |
Apr
(77) |
May
(92) |
Jun
(63) |
Jul
(233) |
Aug
(102) |
Sep
(119) |
Oct
(63) |
Nov
(68) |
Dec
(32) |
| 2008 |
Jan
(69) |
Feb
(91) |
Mar
(129) |
Apr
(44) |
May
(18) |
Jun
(53) |
Jul
(50) |
Aug
(25) |
Sep
(11) |
Oct
(28) |
Nov
(67) |
Dec
(36) |
| 2009 |
Jan
(20) |
Feb
(24) |
Mar
(66) |
Apr
(53) |
May
(48) |
Jun
(48) |
Jul
(59) |
Aug
(82) |
Sep
(49) |
Oct
(30) |
Nov
(16) |
Dec
(16) |
| 2010 |
Jan
(52) |
Feb
(25) |
Mar
(36) |
Apr
(34) |
May
(14) |
Jun
(15) |
Jul
(14) |
Aug
(16) |
Sep
(23) |
Oct
(6) |
Nov
(4) |
Dec
(5) |
| 2011 |
Jan
(4) |
Feb
(22) |
Mar
(45) |
Apr
(9) |
May
(8) |
Jun
(13) |
Jul
(12) |
Aug
(4) |
Sep
(6) |
Oct
(10) |
Nov
(21) |
Dec
(5) |
| 2012 |
Jan
(6) |
Feb
(9) |
Mar
(25) |
Apr
(6) |
May
(4) |
Jun
(23) |
Jul
(6) |
Aug
(18) |
Sep
(21) |
Oct
(34) |
Nov
(19) |
Dec
(25) |
| 2013 |
Jan
(8) |
Feb
(34) |
Mar
(35) |
Apr
(4) |
May
(11) |
Jun
(4) |
Jul
(7) |
Aug
(5) |
Sep
(20) |
Oct
(12) |
Nov
(11) |
Dec
(7) |
| 2014 |
Jan
(10) |
Feb
(18) |
Mar
(50) |
Apr
(26) |
May
(53) |
Jun
(21) |
Jul
(12) |
Aug
(39) |
Sep
(43) |
Oct
(26) |
Nov
(8) |
Dec
(6) |
| 2015 |
Jan
(18) |
Feb
(32) |
Mar
(31) |
Apr
(42) |
May
(38) |
Jun
(13) |
Jul
(6) |
Aug
(11) |
Sep
(29) |
Oct
(25) |
Nov
(10) |
Dec
(11) |
| 2016 |
Jan
(24) |
Feb
(12) |
Mar
(13) |
Apr
(15) |
May
(22) |
Jun
(8) |
Jul
(12) |
Aug
(25) |
Sep
(8) |
Oct
(6) |
Nov
(13) |
Dec
(7) |
| 2017 |
Jan
(6) |
Feb
(29) |
Mar
(32) |
Apr
(8) |
May
(82) |
Jun
(42) |
Jul
(20) |
Aug
(17) |
Sep
(27) |
Oct
(14) |
Nov
(22) |
Dec
(6) |
| 2018 |
Jan
(12) |
Feb
(9) |
Mar
(22) |
Apr
(19) |
May
(14) |
Jun
(9) |
Jul
(9) |
Aug
(22) |
Sep
(22) |
Oct
(12) |
Nov
(13) |
Dec
(8) |
| 2019 |
Jan
(22) |
Feb
(3) |
Mar
(30) |
Apr
(20) |
May
(20) |
Jun
(6) |
Jul
(15) |
Aug
(25) |
Sep
(11) |
Oct
(24) |
Nov
(11) |
Dec
(6) |
| 2020 |
Jan
(9) |
Feb
(12) |
Mar
(29) |
Apr
(10) |
May
(22) |
Jun
(11) |
Jul
(15) |
Aug
(5) |
Sep
(6) |
Oct
(7) |
Nov
(7) |
Dec
(13) |
| 2021 |
Jan
(21) |
Feb
(5) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(7) |
Jul
(6) |
Aug
(8) |
Sep
(5) |
Oct
(9) |
Nov
(5) |
Dec
(6) |
| 2022 |
Jan
(5) |
Feb
(4) |
Mar
(8) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(10) |
Aug
(6) |
Sep
(7) |
Oct
(4) |
Nov
(4) |
Dec
(6) |
| 2023 |
Jan
(5) |
Feb
(5) |
Mar
(6) |
Apr
(4) |
May
(5) |
Jun
(6) |
Jul
(5) |
Aug
(5) |
Sep
(5) |
Oct
(5) |
Nov
(7) |
Dec
(8) |
| 2024 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2025 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2026 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bc...@wo...> - 2001-06-01 10:27:51
|
[Rich Seddon on jython-users]
>We're seeing some behavior with the copy module in
>Jython.
>
>In the following test program, __del__ is only called
>for for the original objects, never for the copied
>ones.
>
>Is this normal?
Nah, it's a bug.
>The same program (without java calls,
>of course) for CPython shows __del__ being called for
>both the original and copied objects.
The problem occur because __del__ is only called when it is defined in
the class dict at the time the class is created. This is slightly more
restrictive than CPython where a __del__ attribute can be added at any
time.
When using copy.copy() & copy.deepcopy(), the new instance is first
created as an empty dummy class and only later is the correct class
assigned to the instance. Because the empty dummy class didn't define a
__del__ method, the method will not be called even when a __del__ method
is acquired later.
The patch below should be usefull as a workaround.
regards,
finn
--- I:\Python21\Lib\copy.py Sat Jan 20 16:47:18 2001
+++ i:\java\jython.CVS\Lib\copy.py Fri Jun 01 10:04:43 2001
@@ -121,7 +121,10 @@
args = x.__getinitargs__()
y = apply(x.__class__, args)
else:
- y = _EmptyClass()
+ if hasattr(x.__class__, '__del__'):
+ y = _EmptyClassDel()
+ else:
+ y = _EmptyClass()
y.__class__ = x.__class__
if hasattr(x, '__getstate__'):
state = x.__getstate__()
@@ -237,7 +240,10 @@
args = deepcopy(args, memo)
y = apply(x.__class__, args)
else:
- y = _EmptyClass()
+ if hasattr(x.__class__, '__del__'):
+ y = _EmptyClassDel()
+ else:
+ y = _EmptyClass()
y.__class__ = x.__class__
memo[id(x)] = y
if hasattr(x, '__getstate__'):
@@ -260,6 +266,12 @@
# Helper for instance creation without calling __init__
class _EmptyClass:
pass
+
+# Helper for instance creation without calling __init__. Used when
+# the source class contains a __del__ attribute.
+class _EmptyClassDel:
+ def __del__(self):
+ pass
def _test():
l = [None, 1, 2L, 3.14, 'xyzzy', (1, 2L), [3.14, 'abc'],
|
|
From: Robert W. B. <rb...@di...> - 2001-06-01 08:26:44
|
Hi Stephen,
On Thu, 31 May 2001, Stephen Schleimer wrote:
> Folk,
>
> I am attempting to embed Jython in a system whose dynamic configuration
> is to include Jython expressions and code fragments. These code
> fragments are runtime evaluated and effect the progress of the overall
> system. The fragments serve as statement guards, iterators, etc.
> Thus, I need to do a good deal of expression evaluation, examine, in
> Java, the results of the evaluation and proceed. Not every expression
> will naturally set a variable in the environment storing its results.
> Thus, I would like to be able to determine the value of the evaluated
> expression without resorting to a storage side effect .
>
> The public interfaces to Py (such as runCode) return a value. However,
> in the way I have been experimenting with them, the value is always
> PyNone. In addition, a printed result of the expression evaluation is
> delivered to sysout.
>
> I am looking, therefore, for a couple of things:
>
> 1) reliably suppressing delivery of the computed result of the
> expression to sysout
> 2) reliably delivering the computed result to the invoker of the
> expression evaluation.
>
> Any aid is appreciated.
I'm probably misunderstanding this, but I think you could use the
PythonInterpreter instance to eval and exec things.
If the code fragments are statement/assignment-free, you can use
interp.eval(fragment) which returns a PyObject.
If statements/assignments exist in the fragments, you can use
interp.exec(someFunnyVar = fragment); then
PyObject x = PyObject.get("someFunnyVar").
Both ways `reliably' get values from the interpreter and neither prints to
stdout unless there is a print statement in the fragment.
Here's an example of eval'ing and exec'ing things and getting objects
from the interpreter in case it helps. I'm not sure I really understand
your situation, so complain lots if I'm way off base.
//====file: test.java
import java.util.Properties;
import org.python.core.*;
import org.python.util.*;
class test {
static PythonInterpreter interp;
public static void main(String[] args) {
Properties props = new Properties();
props.setProperty("python.home", "/home/rbill/jython-2.1a1");
PythonInterpreter.initialize(System.getProperties(), props, new String[0]);
interp = new PythonInterpreter();
// If you truly just need to evaluate, use this
PyObject i = interp.eval("1 and 0 or 2");
System.out.println( i );
// If you write eval'able fragments, return value are automatic.
// Here's another that processes this code file for lines
// containing "eval", plus does some other wacky stuff just to
// show how much can be done in an eval().
i = interp.eval("filter(lambda x: x.find('eval') > -1, [x.strip()[:-1] for x in " +
"open('test.java').readlines() if not x.lstrip().startswith('//')])");
System.out.println(i);
// If eval doesn't cut it,and you really need statements, you
// could assign the results of your fragments to a variable in the
// interpreter and extract it.
interp.exec("import sys; __frag_val = sys.path");
PyObject p = interp.get("__frag_val");
System.out.println(p);
}
}
cheers,
Robert
|
|
From: Stephen S. <ss...@ci...> - 2001-05-31 19:05:51
|
Folk, I am attempting to embed Jython in a system whose dynamic configuration is to include Jython expressions and code fragments. These code fragments are runtime evaluated and effect the progress of the overall system. The fragments serve as statement guards, iterators, etc. Thus, I need to do a good deal of expression evaluation, examine, in Java, the results of the evaluation and proceed. Not every expression will naturally set a variable in the environment storing its results. Thus, I would like to be able to determine the value of the evaluated expression without resorting to a storage side effect . The public interfaces to Py (such as runCode) return a value. However, in the way I have been experimenting with them, the value is always PyNone. In addition, a printed result of the expression evaluation is delivered to sysout. I am looking, therefore, for a couple of things: 1) reliably suppressing delivery of the computed result of the expression to sysout 2) reliably delivering the computed result to the invoker of the expression evaluation. Any aid is appreciated. Response by E-mail would also be appreciated. Thanks -steve |
|
From: Samuele P. <pe...@in...> - 2001-05-31 17:37:05
|
Hi. [Finn] > >I'm asking myself if it would make sense to implement the new CPython > >policy also in Jython > > Yes. > > >File.canonicalPath seems to do the right thing (at least under Windows) > >in order to implement that. > > Yep. Below is my suggested patch. I'm a little worried about what > File.getCanonicalFile() return on platforms other than windows/unix. > The patch is fine for me. I think, it would be nice if someone could test it on MacOS / MacOS X ... Samuele. |
|
From: <ba...@di...> - 2001-05-30 20:40:34
|
>>>>> "FB" == Finn Bock <bc...@wo...> writes:
>> I've missed the start of this thread, but it looks like the
>> Jython project lost some data.
FB> Yes, but it has now been restored by the SF crew.
Ah, good.
>> There were recent reports that a root password was cracked on
>> SF, so I wonder if this is related? I have been downloading
>> nightly snapshots of the cvs repository since 16-May-2001.
FB> Thats good to know. Does that also include these two links?
| http://jython.sourceforge.net/backups/jython-moin.tgz
| http://jython.sourceforge.net/backups/jython-faqw.tgz
Nope, but it does now. :)
FB> It wouldn't have helped us even it did because these files
FB> wasn't created correctly. I have hopefully fixed that bug now.
Okay.
-Barry
|
|
From: <bc...@wo...> - 2001-05-30 20:33:34
|
[Barry] >I've missed the start of this thread, but it looks like the Jython >project lost some data. Yes, but it has now been restored by the SF crew. >There were recent reports that a root >password was cracked on SF, so I wonder if this is related? > >I have been downloading nightly snapshots of the cvs repository since >16-May-2001. Thats good to know. Does that also include these two links? http://jython.sourceforge.net/backups/jython-moin.tgz http://jython.sourceforge.net/backups/jython-faqw.tgz It wouldn't have helped us even it did because these files wasn't created correctly. I have hopefully fixed that bug now. regards, finn |
|
From: Robert W. B. <rb...@di...> - 2001-05-30 19:59:20
|
On Wed, 30 May 2001, Romain Guy wrote:
> Does Jython provides an equivalent of Python 2.1 __main__ ?
yes...
[sh:~/.] jython
Jython 2.1a1 on java1.3.1 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> print __name__
__main__
>>>
The top-level script environment isn't automatic when embedding...
// file: test.java
import java.util.Properties;
import org.python.core.*;
import org.python.util.*;
public class test {
private static PythonInterpreter interp;
public static void main(String[] args) {
Properties props = new Properties();
props.setProperty("python.home", "/home/rbill/jython-2.1a1");
PythonInterpreter.initialize(System.getProperties(), props, new String[0]);
interp = new PythonInterpreter();
// explicitly add __main__
PyModule mod = imp.addModule("__main__");
interp.setLocals(mod.__dict__);
interp.execfile(args[0]);
}
}
cheers,
robert
|
|
From: <ba...@di...> - 2001-05-30 19:15:55
|
I've missed the start of this thread, but it looks like the Jython project lost some data. There were recent reports that a root password was cracked on SF, so I wonder if this is related? I have been downloading nightly snapshots of the cvs repository since 16-May-2001. Finn, if this will help you I'm happy to send you whichever tarball you need. But if the lost data wasn't in cvs, these won't help. -Barry |
|
From: <bc...@wo...> - 2001-05-30 19:02:02
|
[me] >Maybe SF have more recent backups available. I've posted a support request regarding this: http://sourceforge.net/tracker/index.php?func=detail&aid=428769&group_id=1&atid=200001 regards, finn |
|
From: Romain G. <rom...@je...> - 2001-05-30 18:13:37
|
Does Jython provides an equivalent of Python 2.1 __main__ ? Romain "Java Swinguer !" Guy rom...@je... www.jext.org "Now, don't you worry. The saucers are up there. The graveyard is out there. But I'll be locked up safely in there." - Paula Trent, Plan 9 From Outer Space |
|
From: <bc...@wo...> - 2001-05-30 17:26:34
|
[cagi] >In Python I can increase the recursion limit by sys.setrecursionlimit(). >In Jython there isn't such attribute. So I get Exception in thread "main" >java.lang.OutOfMemoryError. But in Java ich could resolve this by starting >java as java -Xmx300000000 (increasing heap size). How can I do this in >Jython2.1? You have to edit the startup script yourself. >The -D flag seams to be similar to the -D flag in Java. Which is a likely source of confusion because they are *not* the same. The jython -D option only sets values in the sys.registry dictionary while the java -D option sets system properties. regards, finn |
|
From: <bc...@wo...> - 2001-05-30 17:26:07
|
On Tue, 29 May 2001 02:57:39 -0300, you wrote: >Hello folks! > >Thanks to Finn Bock valuable hints I have managed to run Jython >over Kaffe 1.0.6 and Guarana 1.7( reflective enhanced JVM built >from Kaffe see http://www.ic.unicamp.br/~oliva/guarana/index.html) > >So I figured is time to change the note in platform.html (Jython's >web site) that states lack od compatibility between jython and Kaffe. > >By the way, congratulations for the great job! Thanks. Did you manage to get the autodiscovery of the java package hierarchies working? Using "add_package" for the java package can only be considered a workaround. Did you find out the why site.py wasn't imported correctly? Since all exceptions from site.py are silently ignored during startup, it is parhaps easier to debug the problem by importing site.py manually. Start the interpreter with -S option like this: i:\>jython -S Jython 2.1a1 on java1.3.0 (JIT: null) >>> import site >>> Could you use kaffe to run the installer? Was the two script created correctly? regards, finn |
|
From: Samuele P. <pe...@in...> - 2001-05-30 17:11:18
|
Hi.
It was just a pilot error <wink>.
Your java class is foo.python.Foo2, you can't get at it as foo.Foo2 in any
case.
Let's see and clarify some other points:
>>> dir ('foo')
[]
I think you meant dir(foo), dir('string') returns always [].
Then:
Jython 2.0 on java1.3.0 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> from foo import *
>>> dir() # current namespace binding names
['Foo', '__doc__', '__name__']
>>> # dir(foo) will fail
>>> Foo()
<foo.Foo instance at 5691336>
>>> python.Foo2() # fails
Traceback (innermost last):
File "<console>", line 1, in ?
NameError: python
>>> # but
>>> import foo
>>> dir(foo)
['Foo', '__doc__', '__file__', '__name__', '__path__']
>>> # jython backtracks
>>> foo.python.Foo2()
foo.python.Foo2@5d5681
>>> ^D
Worth to notice: with respect to from import * and dir a python package
behaves the usual way even when it shadows a java package, making it work
differently will mess up jython code without a real gain: in any case, from
import * and dir nice features with java packages are intended for explorative
interactive use, not for production time. On the other hand
jython backtracks properly to the java package.
regards. Samuele Pedroni.
|
|
From: Chris W. <cw...@am...> - 2001-05-30 01:35:22
|
BTW, the class file was NOT jythonc-compiled. It was javac
compiled.
Thanks.
Chris
> -----Original Message-----
> From: Chris Wong [mailto:cw...@am...]
> Sent: Tuesday, May 29, 2001 6:26 PM
> To: Samuele Pedroni
> Cc: jyt...@li...; cw...@am...
> Subject: Re: [Jython-dev] package resolution for
> jython package and Java
> package
>
>
>
> I have python.path set to ~/lib/python and my
> CLASSPATH set to . and I
> cd to src before I start up jython.
>
> Here is what I got in my path.
>
> src/foo/python/Foo2.class
> src/foo/python/Foo2.java
> lib/python/foo/__init__.py
> lib/python/foo/__init__$py.class
> (See attach tar for the source code.)
>
> __init__.py contains one jython class called Foo
>
> Here is what I did.
>
> ~/src% export CLASSPATH=.
> ~/src% jython
> Jython 2.0 on java1.3.1 (JIT: null)
> Type "copyright", "credits" or "license" for more information.
> >>> from foo import *
> >>> dir ('foo')
> []
> >>> Foo()
> <foo.Foo instance at 7127716>
> >>> Foo2()
> Traceback (innermost last):
> File "<console>", line 1, in ?
> NameError: Foo2
> >>> import foo
> >>> foo.Foo2()
> Traceback (innermost last):
> File "<console>", line 1, in ?
> AttributeError: module 'foo' has no attribute 'Foo2'
> >>>
>
> As you can see, Foo was created correctly, but when I
> try to create Foo2,
> it said module 'foo' has no attribute 'Foo2'. It
> looks like that it's not
> backtracking in this case. Is this normal?
>
> Thanks for any help.
>
> Chris
>
> On Sun, May 27, 2001 at 09:46:29PM +0200, Samuele
> Pedroni wrote:
> > Hi.
> > >
> > > Hi,
> > >
> > > I have a jython package name starting with the
> same package as my
> > > java package. e.g.,
> > >
> > > foo/bar/test.py in Jython
> > >
> > > and
> > >
> > > foo/jython/rocks/RockTheWorld.class in Java
> > >
> > > Let's say I want to use RockTheWorld which is a Java class.
> > > Normally, we use
> > >
> > > from foo.jython.rocks import *
> > >
> > > However, since the jython package has precendence
> over the Java
> > > classpath, Jython says it couldn't find "jython"
> package. The
> > > reason is because both package path starts with foo.
> > >
> > > Here is my question: Why didn't Jython backtrack
> to try the rest
> > > of the path to find foo.jython.rocks package? Is
> this a bug?
> > >
> > As far as I know jython backtracks. This is -
> however - not true with
> > jythonc-ompiled code. Is that your case? otherwise
> you should come
> > with a detailed not working case, I have just tried
> with an example
> > case and everything works fine.
> >
> > regards.
> >
>
|
|
From: Chris W. <cw...@am...> - 2001-05-30 01:26:10
|
I have python.path set to ~/lib/python and my CLASSPATH set to . and I
cd to src before I start up jython.
Here is what I got in my path.
src/foo/python/Foo2.class
src/foo/python/Foo2.java
lib/python/foo/__init__.py
lib/python/foo/__init__$py.class
(See attach tar for the source code.)
__init__.py contains one jython class called Foo
Here is what I did.
~/src% export CLASSPATH=.
~/src% jython
Jython 2.0 on java1.3.1 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> from foo import *
>>> dir ('foo')
[]
>>> Foo()
<foo.Foo instance at 7127716>
>>> Foo2()
Traceback (innermost last):
File "<console>", line 1, in ?
NameError: Foo2
>>> import foo
>>> foo.Foo2()
Traceback (innermost last):
File "<console>", line 1, in ?
AttributeError: module 'foo' has no attribute 'Foo2'
>>>
As you can see, Foo was created correctly, but when I try to create Foo2,
it said module 'foo' has no attribute 'Foo2'. It looks like that it's not
backtracking in this case. Is this normal?
Thanks for any help.
Chris
On Sun, May 27, 2001 at 09:46:29PM +0200, Samuele Pedroni wrote:
> Hi.
> >
> > Hi,
> >
> > I have a jython package name starting with the same package as my
> > java package. e.g.,
> >
> > foo/bar/test.py in Jython
> >
> > and
> >
> > foo/jython/rocks/RockTheWorld.class in Java
> >
> > Let's say I want to use RockTheWorld which is a Java class.
> > Normally, we use
> >
> > from foo.jython.rocks import *
> >
> > However, since the jython package has precendence over the Java
> > classpath, Jython says it couldn't find "jython" package. The
> > reason is because both package path starts with foo.
> >
> > Here is my question: Why didn't Jython backtrack to try the rest
> > of the path to find foo.jython.rocks package? Is this a bug?
> >
> As far as I know jython backtracks. This is - however - not true with
> jythonc-ompiled code. Is that your case? otherwise you should come
> with a detailed not working case, I have just tried with an example
> case and everything works fine.
>
> regards.
>
|
|
From: <bc...@wo...> - 2001-05-29 19:55:23
|
[Samuele] >I have checked the FAQ problem on sourceforge: > >the FAQ/data directory is empty Yep. >There's a backup from Finn(?) but it is maybe a little bit old ... Yep. Its from 21-dec-2000. I've just restored it since that's all we have. >to be precise all our directories (that means the wiki dirs too) with (for cgi >reasons) o+w permissions are empty. Yep. >Someone tried a systemwide rm -rf :( or I'm missing something ... Well, we seems to be missing a lot <wink> of data. Maybe SF have more recent backups available. If not, then I guess we are out of luck. [This time I promise that I'll make sure my backupscript actually gets executed] regards, finn |
|
From: Samuele P. <pe...@in...> - 2001-05-29 14:44:46
|
Hi. I have checked the FAQ problem on sourceforge: the FAQ/data directory is empty There's a backup from Finn(?) but it is maybe a little bit old ... to be precise all our directories (that means the wiki dirs too) with (for cgi reasons) o+w permissions are empty. Someone tried a systemwide rm -rf :( or I'm missing something ... regards. Samuele Pedroni. |
|
From: Rodrigo D. A. S. <Rod...@ic...> - 2001-05-29 05:51:18
|
Hello folks! Thanks to Finn Bock valuable hints I have managed to run Jython over Kaffe 1.0.6 and Guarana 1.7( reflective enhanced JVM built from Kaffe see http://www.ic.unicamp.br/~oliva/guarana/index.html) So I figured is time to change the note in platform.html (Jython's web site) that states lack od compatibility between jython and Kaffe. By the way, congratulations for the great job! best regards Rod Senra -- Rodrigo Senra Computer Engineer (GPr Sistemas Ltda) rod...@gp... MSc Student (IC - UNICAMP) Rod...@ic... Home Page http://www.ic.unicamp.br/~921234 (ICQ 114477550) |
|
From: <bc...@wo...> - 2001-05-28 19:39:09
|
[me]
>Index: org/python/core/imp.java
>===================================================================
>RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v
>retrieving revision 2.42
>...
>+
>+ private static boolean caseok(File file, String filename) {
>+ if (Options.caseok)
>+ return true;
>+ try {
>+ return filename.equals(file.getCanonicalFile().getName());
Duh. The line above doesn't work on jdk1.1. It should instead be:
File canFile = new File(file.getCanonicalPath());
return filename.equals(canFile.getName());
>+ } catch (IOException exc) {
>+ return false;
>+ }
> }
regards,
finn
|
|
From: <bc...@wo...> - 2001-05-28 18:01:52
|
On Mon, 28 May 2001 18:39:39 +0200 (MET DST), you wrote:
>Hi
>
>[Finn on jython-users]
>>
>> >I have the following situation, which strikes me as bizarre:
>>
>> I have been unable to reproduce the problem with just your example
>> (included below). OTOH case-sensitive import doesn't work right (when
>> compared to all versions of CPython) on case-insensitive filesystems.
>>
>I'm asking myself if it would make sense to implement the new CPython
>policy also in Jython
Yes.
>(anyway, that would be a low prio thing)
>
>File.canonicalPath seems to do the right thing (at least under Windows)
>in order to implement that.
Yep. Below is my suggested patch. I'm a little worried about what
File.getCanonicalFile() return on platforms other than windows/unix.
regards,
finn
Index: registry
===================================================================
RCS file: /cvsroot/jython/jython/registry,v
retrieving revision 2.13
diff -u -r2.13 registry
--- registry 2001/05/28 16:56:37 2.13
+++ registry 2001/05/28 16:56:56
@@ -55,6 +55,14 @@
#python.options.internalTablesImpl = soft
#python.options.internalTablesImpl = weak
+# Setting this to true will force Jython will use the first module
+# found on sys.path where java File.isFile() returns true.
+# Setting this to true has no effect on unix-type filesystems.
+# On Windows/HPS+ systems, setting it to true will enable Jython-2.0
+# behaviour.
+python.options.caseok = false
+
+
# Use this registry entry to control the list of builtin modules; you
# can add, remove, or override builtin modules. The value for this
# registry key is a comma separated list of module entries, each entry
Index: org/python/core/Options.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/Options.java,v
retrieving revision 2.7
diff -u -r2.7 Options.java
--- org/python/core/Options.java 2001/03/04 18:04:31 2.7
+++ org/python/core/Options.java 2001/05/28 16:56:59
@@ -73,6 +73,14 @@
*/
public static String proxyDebugDirectory = null;
+ /**
+ * If true, Jython will use the first module found on sys.path
+ * where java File.isFile() returns true. Setting this to true
+ * have no effect on unix-type filesystems. On Windows/HPS+
+ * systems setting it to true will enable Jython-2.0 behaviour.
+ */
+ public static boolean caseok = false;
+
//
// ####### END OF OPTIONS
//
@@ -143,6 +151,10 @@
throw Py.ValueError("Illegal verbose option setting: '"+
prop+"'");
}
+
+ Options.caseok =
+ getBooleanOption("options.caseok", Options.pollStandardIn);
+
// additional initializations which must happen after the registry
// is guaranteed to be initialized.
JavaAccessibility.initialize();
Index: org/python/core/imp.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v
retrieving revision 2.42
diff -u -r2.42 imp.java
--- org/python/core/imp.java 2001/05/27 18:49:15 2.42
+++ org/python/core/imp.java 2001/05/28 16:57:29
@@ -294,7 +294,7 @@
// First check for packages
File dir = new File(dirName, name);
- if (dir.isDirectory() &&
+ if (dir.isDirectory() && caseok(dir, name) &&
(new File(dir, "__init__.py").isFile() ||
new File(dir, "__init__$py.class").isFile()))
{
@@ -313,8 +313,8 @@
File classFile = new File(dirName, className);
Py.writeDebug("import", "trying source " + pyFile.getPath());
- if (pyFile.isFile()) {
- if (classFile.isFile()) {
+ if (pyFile.isFile() && caseok(pyFile, pyName)) {
+ if (classFile.isFile() && caseok(classFile, className)) {
Py.writeDebug("import", "trying precompiled " +
classFile.getPath());
long pyTime = pyFile.lastModified();
@@ -333,12 +333,22 @@
// If no source, try loading precompiled
Py.writeDebug("import", "trying " + classFile.getPath());
- if (classFile.isFile()) {
+ if (classFile.isFile() && caseok(classFile, className)) {
return createFromPyClass(modName, makeStream(classFile),
false, classFile.getPath());
}
}
return null;
+ }
+
+ private static boolean caseok(File file, String filename) {
+ if (Options.caseok)
+ return true;
+ try {
+ return filename.equals(file.getCanonicalFile().getName());
+ } catch (IOException exc) {
+ return false;
+ }
}
static PyObject loadFromClassLoader(String name,
|
|
From: Samuele P. <pe...@in...> - 2001-05-28 16:39:44
|
Hi [Finn on jython-users] > > >I have the following situation, which strikes me as bizarre: > > I have been unable to reproduce the problem with just your example > (included below). OTOH case-sensitive import doesn't work right (when > compared to all versions of CPython) on case-insensitive filesystems. > I'm asking myself if it would make sense to implement the new CPython policy also in Jython (anyway, that would be a low prio thing) File.canonicalPath seems to do the right thing (at least under Windows) in order to implement that. Opinions? regards, Samuele Pedroni. |
|
From: Samuele P. <pe...@in...> - 2001-05-27 19:46:34
|
Hi. > > Hi, > > I have a jython package name starting with the same package as my > java package. e.g., > > foo/bar/test.py in Jython > > and > > foo/jython/rocks/RockTheWorld.class in Java > > Let's say I want to use RockTheWorld which is a Java class. > Normally, we use > > from foo.jython.rocks import * > > However, since the jython package has precendence over the Java > classpath, Jython says it couldn't find "jython" package. The > reason is because both package path starts with foo. > > Here is my question: Why didn't Jython backtrack to try the rest > of the path to find foo.jython.rocks package? Is this a bug? > As far as I know jython backtracks. This is - however - not true with jythonc-ompiled code. Is that your case? otherwise you should come with a detailed not working case, I have just tried with an example case and everything works fine. regards. |
|
From: Samuele P. <pe...@in...> - 2001-05-27 19:25:08
|
Hi
[Rich Seddon]
> However, by running jdb I found the spot where these are being lost.
> In PyModule.java, there is a method called "impHook", which has the
> following lines.
>
> private static PyObject impHook(String name) {
> if (silly_list == null) {
> silly_list = new PyTuple(new PyString[] {
> Py.newString("__doc__"),});
> }
> try {
> return __builtin__.__import__(name, null, null, silly_list);
> } catch(PyException e) {
> return null;
> }
> }
>
> The SyntaxError gets caught here, and is never seen again. :-)
>
> Is there a fix/workaround for this?
I think we could simply remove the try/catch. Any other ideas?
Note: (if I remember well) this code is only called if one tries to load a
jython package as:
import jypkg1
jypkg1.jypkg2.foofunc()
this is supported by jython but the correct python code would use:
import jypkg1.jypkg2
In python one cannot refer to packages without first importing them.
regards, Samuele Pedroni.
|
|
From: <no...@so...> - 2001-05-27 18:57:26
|
Patches item #425684, was updated on 2001-05-20 09:24 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=312867&aid=425684&group_id=12867 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Samuele Pedroni (pedronis) Assigned to: Nobody/Anonymous (nobody) Summary: nested scopes (2) Initial Comment: completes nested scopes support in interpreter: now nested scopes semantic settings are inherited trough exec, execfile, etc ... plus: assert now correctly get __debug__ as a global ---------------------------------------------------------------------- >Comment By: Samuele Pedroni (pedronis) Date: 2001-05-27 11:57 Message: Logged In: YES user_id=61408 committed. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=312867&aid=425684&group_id=12867 |
|
From: <no...@so...> - 2001-05-27 18:57:01
|
Patches item #425688, was updated on 2001-05-20 09:30 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=312867&aid=425688&group_id=12867 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Samuele Pedroni (pedronis) Assigned to: Nobody/Anonymous (nobody) Summary: jythonc nested scopes support Initial Comment: just tested with: demo/javaclasses compiles test_scope* correctly and to a properly working .class ---------------------------------------------------------------------- >Comment By: Samuele Pedroni (pedronis) Date: 2001-05-27 11:57 Message: Logged In: YES user_id=61408 committed. ---------------------------------------------------------------------- Comment By: Samuele Pedroni (pedronis) Date: 2001-05-20 09:31 Message: Logged In: YES user_id=61408 should also solve #222834 import * into locals <wink> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=312867&aid=425688&group_id=12867 |