You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Karthik G. <kar...@az...> - 2001-12-22 11:10:03
|
hi all, This is my first post to the list. Our company does'nt use python. many have'nt even heard of it. Ours is mainly a java shop. We have lots of internal training sessions @ our place. Anyone with a decent knowledge of a particular subject can take such sessions. I was planning to take an introductory session on python. I feel irrespective of how good the language is, not many w'd want to try it out unless and otherwise they can see lots of supporting tools and libraries. it has to be 1 hour talk. I have picked up a few topics. Ours being a java shop, i feel, the most important topic would be jython. Any suggestion w'd be of great help to me. Please give me ideas of some simple demonstration i can do with jython. Something that w'd've some effect on our guys. I wrote small gui stuff in swing using jython. I can probably show how the number of lines is far less that what you w'd write for a typical java swing application. I need more intutive stuff. am no expert, infact am a newbie but am comfortable woth python syntax, features. who wants to spread the usage of python/jython @ our place. But unless i tell them how i managed to get something done easily using jython, they w'd'nt be impressed. like some examples of what i can achieve by embedding the jython interpreter inside my java code in a very efficient manner. Any inputs/ideas for the demo would be of great help to me. thanks, karthik. |
From: Jason D. <ja...@pl...> - 2001-12-22 07:42:38
|
Well, after a little more investigation I was able to get the compile error to reoccur when I was not using a package name. command/executor needed support, since it defines a psuedo abstract class which performs the magic to call the superclass constructor or not, plus adding the ability to call getName() by masking it to a call to name(). Don't really know what is up with that, but I could not find any way to call a getName() method on a super class... seems to want to turn it into a call to Class or something. Anyways. I played with the generated source for command/executor.java, added an 'import support;' and then it would compile fine with out a package name. But when it it comes time to import the namespace from support, it freaks out about missing names. Which certainly exist, as when I copy the exact file to command/ it works. Anyways, the working 'support' name is registered as a PyModule, where as the broken 'support' name is a PyJavaClass... which is probably because I added the explicit import... but I don't really know if that is true. After littering the current code base with System.out's it looks like it can't find its parent module (pytest.command), so that is probably why it doesn't try to search up for the support module. So why doesn't the jythonc'd version pay attention to the command/__init__.py ? I tried compliing command and command.executor, but I get a NPE which I don't even know where to start looking for the problem there. So then I tried added a toplevel main.py, which explicitly imported all of the nested modules and packages. Could not from XXX import * either, or modules listed in the package __all__ would not get loaded. Still can't find parent module... Well, I think I am going to put this away for a while. I hope that I am just missing something, as it would be really nice to get this functional. I suppose I could look into driving the execution from Jython, but then I have more work ahead of me to rebuild the functionality of the Ant tasks. Perhaps that is best anyways, since there are minor compatibility issues when jythonc is tossed in the mix. =( --jason |
From: Jason D. <ja...@pl...> - 2001-12-22 05:39:58
|
A little background... I am tring to setup an environment where I can use Jython with JUnit to test Java systems. I also didn't want to loose the ability to use pure java tests and wanted to make use of the current Ant tasks to run the tests and generate reports. From the first glance it looks like jythonc is exactly what I want... and well it sort of works, but it is very touchy about what it can do. I had things working, then broke it by a minor change (which didn't affect the running of the .py's), spent hours finding out what was wrong... then did the same thing all over again. So, I have overcome the hurdle of having a Jython class extend from junit.framework.TestCase, and pass its name in the constructor (for both compiled and interpreted use). The problem I am running into now, is that I moved some of the support bits that allow the above to work into a support.py module... well that isn't what actually caused the problem, the actual problem was when I tried using a package to better organize tests. What I have is something like this: src/py/support.py src/py/command/__init__.py src/py/command/executor.py I am setting -Dpython.path=src/py and running jythonc with arguments like: jythonc --deep --package my.package.pytest --workdir output/jpywork --falsenames ENABLE_SUPER_CLASS_INIT support command.executor Which produces output like this: <snip> processing support processing command.executor Required packages: javax.naming junit.framework com.boldfish.test junit.textui com.boldfish.ben.system.command.test Creating adapters: Creating .java files: executor module ExecutorTestCase extends my.package.pytest.support.AbstractTestCase support module AbstractTestCase extends junit.framework.TestCase </snip> So far so good... until I try to startup the test runner. I get a "ImportError: no module named support" exception when running. I have found that if I copy src/py/support.py to src/py/command, re-compile specifing command.support and run that it works. So I am wondering why it can't find the support module when it is in its parent package? I tried playing around with looking it up with the full java package name, but ran into problems with the 'pytest' module, which did not exist. * * * This is really close to working, but I would rather not have to duplicate support.py or maintain a flat namespace for tests. I would like to avoid having to write JUnit in Java though (way to much work)... so I have to figure something out. I was going to try setting up the full java package structure in src/py, but I don't know if that will work. I did try omitting the packagname, but ran into odd compile problems in some circumstances, and yet it worked in others. This seems very tempermental. Can some one help me understand what I need to tame this beast? Thanks, --jason |
From: Updike, C. <Cla...@jh...> - 2001-12-22 04:42:01
|
I'm trying to run the Hello.py servlet example but I get the exception from Tomcat shown below. The strange thing is that I can execute the statement execfile('C:\\Program Files\\Apache Tomcat 4.0\\webapps\\JythonServlet\\Hello.py') from the interpreter without getting the 'invalid syntax' problem (which I think shows that the path is valid). Anyone have any ideas? TIA, Clark javax.servlet.ServletException: Could not create Jython servletTraceback (innermost last): (no code object) at line 0 SyntaxError: ('invalid syntax', ('C:\\Program Files\\Apache Tomcat 4.0\\webapps\\JythonServlet\\Hello.py', 3, 9, ' class Hello(javax.servlet.http.HttpServlet):')) at org.python.util.PyServlet.loadServlet(PyServlet.java) at org.python.util.PyServlet.getServlet(PyServlet.java) at org.python.util.PyServlet.service(PyServlet.java) <snip> P.S. The exception is from this code block in PyServlet.java, loadServlet(): try { interp.execfile(path); PyObject cls = interp.get(name); if (cls == null) throw new ServletException("No callable (class or function) "+ "named " + name + " in " + path); PyObject pyServlet = cls.__call__(); Object o = pyServlet.__tojava__(HttpServlet.class); if (o == Py.NoConversion) throw new ServletException("The value from " + name + "must extend HttpServlet"); servlet = (HttpServlet)o; servlet.init(getServletConfig()); } catch (PyException e) { throw new ServletException("Could not create "+ "Jython servlet" + e.toString()); } at org.python.util.PyServlet.loadServlet(PyServlet.java) at org.python.util.PyServlet.getServlet(PyServlet.java) at org.python.util.PyServlet.service(PyServlet.java) <snip> |
From: <bc...@wo...> - 2001-12-21 22:32:44
|
I am happy to announce the second beta release of Jython 2.1. Jython is a Java implementation of the Python programming language. It allows users to compile Python source code to Java byte codes, and run the resulting bytecodes on any Java Virtual Machine. It is a very seamless and smooth integration with Java: from Python you have complete access to all Java libraries, can build applets, can integrate with Java beans, and can subclass Java classes in Python and vice versa. Like Python, and unlike Java, Jython can also be used interactively: just type some Jython code at the prompt and see the results immediately. A java installer is available for download at the Jython website: http://www.jython.org/ Installation of version 2.1b2 is similar to version 2.0. Further information and tips on installation is available at: http://www.jython.org/install.html Jython 2.1 aims to be feature compatible with Python 2.1.1 and among the new feature are: - support for callproc() in zxJDBC is now available for most simple stored procedure calls. The list of bugs fixed since the previous release includes: - [ #451552 ] case insensitivity on import causes prob - [ #456926 ] PackageManager doesn't work correctly - [ #484949 ] __import__(_) does unwanted rel search - [ #488632 ] -c sys.argv diff - [ #489168 ] Parse error, java traceback - [ #489836 ] Private names is not mangled - [ #490157 ] string.splitlines() - incorrectly splits - [ #490230 ] NotImplemented not implemented - [ #490961 ] PyFile.java requires JDK 1.2 - [ #490962 ] Typo in PyFile.java - [ #490963 ] Please update ReadlineConsole.java - [ #494514 ] Python object not gc()'d - [ #495458 ] multi level import from .zip file. - [ #495870 ] zxJDBC now only prepares statements with params. A complete list of changes and differences are available here: http://www.jython.org/NEWS.html Bugs can be reported to the bug manager on SourceForge: http://sourceforge.net/bugs/?group_id=12867 Cheers, the jython-developers |
From: Phil S. <psu...@es...> - 2001-12-21 16:17:19
|
I submitted a patch to support this to jython-dev a while back. [I said] After poking through the jython code, I found that this patch to org/jython/core/imp.java in jython-2.1a3 does the trick: imp.java 498a499,502 > //if it's not a builtin or in the python path, try the classpath > ret = loadFromClassLoader(name, imp.class.getClassLoader()); > if (ret != null) return ret; > to put this into context: private static PyObject load(String name, PyList path) { PyObject ret = loadBuiltin(name, path); if (ret != null) return ret; ret = loadFromPath(name, path); if (ret != null) return ret; > //if it's not a builtin or in the python path, try the classpath > ret = loadFromClassLoader(name, imp.class.getClassLoader()); > if (ret != null) return ret; > -----Original Message----- From: Duane [mailto:dpk...@ur...] Sent: Monday, December 17, 2001 5:04 PM To: jyt...@li... Subject: [Jython-users] Using Jython with Java Web Start I'd like to jar up my py files (or *$py.class files) into one jar and jump into my application with Java Web Start. With Java Web start, you can only specify jar files, not py files. I cannot use the python.path since Web Start renames the jar files and puts them in an unknown location. Is there a way to make jython get the py files using Class.getResource() instead of looking locally for a file? That could be usefull for standard applications as well. |
From: Phil S. <psu...@es...> - 2001-12-21 15:31:36
|
Here is a really good article explaining how java2 classloading works: http://www.javageeks.com/Papers/ClassForName/ClassForName.pdf I read this a while ago, but: In short, classes from extensions can only access classes in the boot class path (which is usually only rt.jar). Classes in the 'normal' classpath cannot be seen from an extensions. IMO, extensions are evil. -----Original Message----- From: bc...@wo... [mailto:bc...@wo...] Sent: Monday, November 26, 2001 11:34 AM To: jyt...@li... Subject: [Jython-users] Re: Import strange error >| My guess is that jython.jar exists in jre/lib/ext and that is the reason >| that jython can only load other code that also reside on the >| boot-classpath. > >Yes it actually is. I put everything I need in the jre/lib/ext dir to=20 >avoid classpath problems. Is there a side effect of putting jython in=20 >this directory? It seems like the classloader that is loading extentions does not itself search the classpath. I can't find a place in the Java documentation stating that it is the case, but you can verify that it is by putting your Test.class in a .jar file and copy the jar file to jre/lib/ext. I predict that the Test program also fails then. >I cannot see why putting the jython.jar in this=20 >directory would prevent to load classpath items physically located=20 >elsewhere? It is the classloader that loaded the jython.jar that decides. When running with jython.jar in my jre/liv/ext, I get see that it is an ExtClassLoader that loaded jython. Jython 2.1b1 on java1.4.0-beta3 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import org >>> org.python.core.Py.classLoader sun.misc.Launcher$ExtClassLoader@9fef6f >>> I get: >>> *sys-package-mgr*: processing new jar,=3D20 >>> = >'/Users/spierre/Projects/SPEdit/prototype/build/SPEdit.app/Contents/Resour= >=3D >>> ces/Java/SPEdit.jar' >> >> Hmm, that output can't be from your little java program. > >Well I did not put anything else than the program. The jython.jar seems >to be automatically loaded and processes the classpath items. Yuck. >I think >even if the -cp option is specified the jvm goes looking into the=20 >/jre/lib/ext. This is strange but understandable... That part is documented: http://java.sun.com/docs/books/tutorial/ext/basics/load.html regards, finn _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Jeff E. <je...@ad...> - 2001-12-20 22:20:29
|
import java a = java.lang.reflect.Array.newInstance(java.lang.Double.TYPE,[n1,n2]) Scott Bortman wrote: > Hello Jython-ers, > > I'm trying to pass a double[][] array from jython to java class. > I can see how to do it for 1D using the array function. But what > about if there's more than one dimension? > > Any ideas? Thanks, > --scottie > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: <Mat...@i2...> - 2001-12-20 21:32:45
|
Is there an easy way to dynamically change the classpath that jython uses to resolve Java symbols? i.e. If I started the jython interpreter using a classpath that didn't contain foo.jar, but I need foo.jar in the classpath to resolve com.foo.Foo, how would I add foo.jar to the classpath before execing a script that needs it? I know I can use the jreload module, but its slow and forces an extra module to the front of the import of the java package. What I'd like is to be able to tell the interpreter to use a different classpath/classloader for resolving. bar.py: print "in bar" setcp("/path/to/foo.jar") execfile("foo.py") foo.py: print "in foo" from com.foo import Foo f = Foo() |
From: Scott B. <sbo...@im...> - 2001-12-20 21:28:24
|
Hello Jython-ers, I'm trying to pass a double[][] array from jython to java class. I can see how to do it for 1D using the array function. But what about if there's more than one dimension? Any ideas? Thanks, --scottie |
From: <bc...@wo...> - 2001-12-19 12:37:10
|
[Guillaume Rousse ] >Hello, this might interest you :-) >I patched the ant build script for creating javadoc, i'm joining the patch in >case it could be of any interest We have already added a slightly different java-doc target to the build.xml used for 2.1. regards, finn |
From: Guillaume R. <ro...@cc...> - 2001-12-19 10:04:05
|
Hello, this might interest you :-) I patched the ant build script for creating javadoc, i'm joining the patch in case it could be of any interest ---------- Message transmis ---------- Subject: [JPackage-announce] [RPM] jython-2.0-1jpp Date: Wed, 19 Dec 2001 10:52 +0100 From: Guillaume Rousse <gui...@us...> To: jpa...@li... Resistance is futile, you will be packaged ------- Name : jython Relocations: (not relocateable) Version : 2.0 Vendor: JPackage project Release : 1jpp Build Date: Wed Dec 19 10:50:54 2001 Install date: (not installed) Build Host: silbermann.snv.jussieu.fr Group : Development/Java Source RPM: (none) Size : 517260 License: Modified CNRI Open Source License Packager : Guillaume Rousse <gui...@us...> URL : http://jython.sourceforge.net Summary : Java source interpreter Description : Jython is an implementation of the high-level, dynamic, object-oriented language Python seamlessly integrated with the Java platform. The predecessor to Jython, JPython, is certified as 100% Pure Java. Jython is freely available for both commercial and non-commercial use and is distributed with source code. Jython is complementary to Java and is especially suited for the following tasks: Embedded scripting - Java programmers can add the Jython libraries to their system to allow end users to write simple or complicated scripts that add functionality to the application. Interactive experimentation - Jython provides an interactive interpreter that can be used to interact with Java packages or with running Java applications. This allows programmers to experiment and debug any Java system using Jython. Rapid application development - Python programs are typically 2-10X shorter than the equivalent Java program. This translates directly to increased programmer productivity. The seamless interaction between Python and Java allows developers to freely mix the two languages both during development and in shipping products. ------- Tue Dec 18 2001 Guillaume Rousse <gui...@us...> 2.0-1jpp - first JPackage release -- http://jpackage.sourceforge.net _______________________________________________ Jpackage-announce mailing list Jpa...@li... https://lists.sourceforge.net/lists/listinfo/jpackage-announce ------------------------------------------------------- -- Guillaume Rousse <ro...@cc...> GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html |
From: dman <ds...@ri...> - 2001-12-19 00:09:05
|
On Tue, Dec 18, 2001 at 09:46:50AM +0100, Barry Gaunt wrote: | Hi, | Swing's JMenuItem has a constructor which takes a string and an int. ^^^ "A" is a string (or char), not an int. Try JMenuItem( "Argh!", ord("A") ). >>> java.lang.Character.getNumericValue( "A" ) 10 >>> java.lang.Character.getNumericValue( "B" ) 11 it looks to me like that java method is reading the character as a hex digit, but it goes beyond the base 16 limit. >>> java.lang.Character.getNumericValue( "F" ) 15 >>> java.lang.Character.getNumericValue( "G" ) 16 >>> java.lang.Character.getNumericValue( "H" ) 17 -D -- Contrary to popular belief, Unix is user friendly. It just happens to be selective about who it makes friends with. -- Dave Parnas |
From: <bc...@wo...> - 2001-12-18 19:28:32
|
[Robertson, Jason V] >Hi, > >I've been using Jython for a little while for some Jini/client-server stuff, >and I really like it so far except for little things that come up I don't >understand. > >I've got a few basic (probably dumb) questions. I would _love_ to have been >able to search the jython-users archive but I can't seem to find a search >option for the archive (which is insane - surely I'm just not seeing it?) Maybe this archive is better: http://aspn.activestate.com/ASPN/Mail/Archives/Jython-users/ >Anyway, I can't get this to work from Jython-2.1b1: >sys.tracebacklimit = 0 It isn't implemented yet. >It still prints a full stack trace for uncaught exceptions. > >Second, does Jython not capture an exception and all subclasses of that >exception? Why does this work: > >try: > something() >except java.lang.ClassCastException, x: > print x > >And this doesn't (ClassCastException _is_ a type of Exception) >try: > something() >except java.lang.Exception, x: > print x > Not sure. This works for me: Jython 2.1b1 on java1.4.0-beta3 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import java >>> try: ... raise java.lang.ClassCastException("foobar") ... except java.lang.Exception, x: ... print "Got it:", x ... Got it: java.lang.ClassCastException: foobar >>> regards, finn |
From: Robertson, J. V <jas...@in...> - 2001-12-18 18:19:42
|
Hi, I've been using Jython for a little while for some Jini/client-server stuff, and I really like it so far except for little things that come up I don't understand. I've got a few basic (probably dumb) questions. I would _love_ to have been able to search the jython-users archive but I can't seem to find a search option for the archive (which is insane - surely I'm just not seeing it?) Anyway, I can't get this to work from Jython-2.1b1: sys.tracebacklimit = 0 It still prints a full stack trace for uncaught exceptions. Second, does Jython not capture an exception and all subclasses of that exception? Why does this work: try: something() except java.lang.ClassCastException, x: print x And this doesn't (ClassCastException _is_ a type of Exception) try: something() except java.lang.Exception, x: print x Thanks, Jason |
From: Jim Trampolining.c. at D. <ji...@tr...> - 2001-12-18 17:04:51
|
Does this help ?: >>> upper=String("A") >>> upperNum=u.getBytes()[0] >>> upperNum 65 >>> lower=String("a") >>> lowerNum=lower.getBytes()[0] >>> lowerNum 97 >>> type(lowerNum) <jclass org.python.core.PyInteger at 7320312> >>> >12/18/2001 12:46:50 AM, Barry Gaunt <bar...@cs...> wrote: > >Hi, > Swing's JMenuItem has a constructor which takes a string and an int. >It can be used like this: JMenuItem("Argh!", "A") where the "A" is a shortcut character. > >I have tried to do this in jpython like this: > >from java.lang import * >shortcutChar = Character.getNumericValue(String("A").charAt(0)) >jmi = JMenuItem("Argh!", shortcutChar) > >The values returned in shortcutChar are wrong, for example "A" and "a" both give >the value 10. > >Any one knows what's up? > >I have tried plain: jmi=JMenuItem("Argh!", "A") but that gets rejected. > >Thanks >-Barry > > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users > _____________________ __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸`-' `-' "Programming is not communicating with the computer, it is communicating with the programmer who comes after you". - Code Complete |
From: Andrew K. <aku...@me...> - 2001-12-18 15:40:25
|
On Tue, Dec 18, 2001 at 01:36:21PM +0000, Finn Bock wrote: >Are you completely sure. If I create a file called "strop.class" in my >cwd, I get the very same error: Pretty sure: ute awt>jar -t <microscope.jar |grep str string.class string$_PyInner.class org/python/core/PyReflectedConstructor.class ute awt> Hmm... the problem might be due to the bug described at http://developer.java.sun.com/developer/bugParade/bugs/4196224.html; the JDK doesn't find a .class file in the JAR, tries to download it using HTTP, doesn't find it, and reports the 'bad magic number' error. That explains why it only shows up when running as an applet. (However, it also shows up with IBM's 1.3 JDK; oh dear...) A workaround is to edit string.py to not try importing strop. Maybe string.py should only try to import strop in CPython. --amk |
From: Humbel O. <Otm...@bi...> - 2001-12-18 13:40:44
|
Hello Barry, I don't think Jython is to blame here. Consider the following java = program and it's output: package CH.obj.Libraries.Utility; public class CharacterTest { public static void main( String args[] ) { String upper =3D new String( "A" ); String lower =3D new String( "a" ); int upperNum =3D Character.getNumericValue( upper.charAt(0) ); int lowerNum =3D Character.getNumericValue( lower.charAt(0) ); System.out.println(" num value of " + upper.charAt(0) + " =3D " + = upperNum ); System.out.println(" num value of " + lower.charAt(0) + " =3D " + = lowerNum ); } } [infra|pwe] > java CH.obj.Libraries.Utility.CharacterTest num value of A =3D 10 num value of a =3D 10 [infra|pwe] > java -version java version "1.3.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C) Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode) (on Win2K) Best wishes, Oti. |
From: <bc...@wo...> - 2001-12-18 13:32:38
|
[Andrew Kuchling] >I'm trying to build an applet with Jython 2.0 (it worked fine with >1.0something), and am getting a mysterious error from the resulting >JAR file. > >Java Traceback: > at org.python.core.Py.JavaError(Py.java:238) > at org.python.core.Py.findClassEx(Py.java:620) > ... > at java.lang.Thread.run(Thread.java:484) >Traceback (innermost last): > File "/home/akuchlin/src/mems/proto3/instrument/client/awt/MicroscopeApplet.py", line 0, in main > File "/home/akuchlin/src/mems/proto3/instrument/client/awt/PyClient.py", line 0, in main > File "/usr/local/jython-2.0/Lib/string.py", line 0, in main >java.lang.ClassFormatError: strop (Bad magic number) > >(Full traceback below, in case that information is useful.) >Inspecting the JAR file finds that strop.class isn't in it, Are you completely sure. If I create a file called "strop.class" in my cwd, I get the very same error: [d:\]\jython\jython-2.0-jdk14\jython.bat -S Jython 2.0 on java1.4.0-beta3 (JIT: null) >>> import string >>> ^Z [d:\]\jython\jython-2.0-jdk14\jython.bat -S Jython 2.0 on java1.4.0-beta3 (JIT: null) >>> f = open("strop.class", "w") >>> f.write("foobar") >>> f.close() >>> import string Traceback (innermost last): File "<console>", line 1, in ? File "d:\jython\jython-2.0-jdk14\Lib\string.py", line 418, in ? java.lang.ClassFormatError: strop (Bad magic number) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:512) at java.lang.ClassLoader.defineClass(ClassLoader.java:441) >but string.py should surely get an ImportError and continue running. Well yeah, but we have had huge problems in previous situation when we did catch java exceptions during import and tried to turn it into a python exception. And this is after all a java error, and as Javasoft say: """An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions.""" >The >same error occurs with both the Sun and IBM JVMs. Has anyone seen this >before? Anyone got a clue about its cause? Only that some old broken strop.class file is laying around somewhere on your CLASSPATH. Maybe it is in org/python/modules where the original strop.java was. regards, finn |
From: Barry G. <bar...@cs...> - 2001-12-18 08:54:01
|
Hi, Swing's JMenuItem has a constructor which takes a string and an int. It can be used like this: JMenuItem("Argh!", "A") where the "A" is a shortcut character. I have tried to do this in jpython like this: from java.lang import * shortcutChar = Character.getNumericValue(String("A").charAt(0)) jmi = JMenuItem("Argh!", shortcutChar) The values returned in shortcutChar are wrong, for example "A" and "a" both give the value 10. Any one knows what's up? I have tried plain: jmi=JMenuItem("Argh!", "A") but that gets rejected. Thanks -Barry |
From: Andrew K. <aku...@me...> - 2001-12-17 22:25:27
|
I'm trying to build an applet with Jython 2.0 (it worked fine with 1.0something), and am getting a mysterious error from the resulting JAR file. Java Traceback: at org.python.core.Py.JavaError(Py.java:238) at org.python.core.Py.findClassEx(Py.java:620) ... at java.lang.Thread.run(Thread.java:484) Traceback (innermost last): File "/home/akuchlin/src/mems/proto3/instrument/client/awt/MicroscopeApplet.py", line 0, in main File "/home/akuchlin/src/mems/proto3/instrument/client/awt/PyClient.py", line 0, in main File "/usr/local/jython-2.0/Lib/string.py", line 0, in main java.lang.ClassFormatError: strop (Bad magic number) (Full traceback below, in case that information is useful.) Inspecting the JAR file finds that strop.class isn't in it, but string.py should surely get an ImportError and continue running. The same error occurs with both the Sun and IBM JVMs. Has anyone seen this before? Anyone got a clue about its cause? --amk Java Traceback: at org.python.core.Py.JavaError(Py.java:238) at org.python.core.Py.findClassEx(Py.java:620) at org.python.core.SysPackageManager.findClass(SysPackageManager.java:91) at org.python.core.PackageManager.findClass(PackageManager.java:19) at org.python.core.SysPackageManager.findClass(SysPackageManager.java:83) at org.python.core.PyJavaPackage.__findattr__(PyJavaPackage.java:128) at org.python.core.PackageManager.lookupName(PackageManager.java:96) at org.python.core.imp.load(imp.java:361) at org.python.core.imp.load(imp.java:376) at org.python.core.imp.importName(imp.java:447) at org.python.core.imp.importName(imp.java:509) at org.python.core.ImportFunction.load(__builtin__.java:967) at org.python.core.ImportFunction.__call__(__builtin__.java:961) at org.python.core.PyObject.__call__(PyObject.java:250) at org.python.core.__builtin__.__import__(__builtin__.java:921) at org.python.core.imp.importFromAs(imp.java:566) at string$_PyInner.main$27(string.java:724) at string$_PyInner.call_function(string.java:228) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.imp.createFromCode(imp.java:157) at org.python.core.imp.createFromClass(imp.java:178) at org.python.core.imp.loadPrecompiled(imp.java:246) at org.python.core.imp.loadFromPath(imp.java:257) at org.python.core.imp.loadFromPath(imp.java:252) at org.python.core.imp.load(imp.java:357) at org.python.core.imp.load(imp.java:376) at org.python.core.imp.importName(imp.java:447) at org.python.core.imp.importName(imp.java:509) at org.python.core.ImportFunction.load(__builtin__.java:967) at org.python.core.ImportFunction.__call__(__builtin__.java:961) at org.python.core.PyObject.__call__(PyObject.java:250) at org.python.core.__builtin__.__import__(__builtin__.java:921) at org.python.core.imp.importOne(imp.java:518) at PyClient$_PyInner.main$20(PyClient.java:736) at PyClient$_PyInner.call_function(PyClient.java:246) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.imp.createFromCode(imp.java:157) at org.python.core.imp.createFromClass(imp.java:178) at org.python.core.imp.loadPrecompiled(imp.java:246) at org.python.core.imp.loadFromPath(imp.java:257) at org.python.core.imp.loadFromPath(imp.java:252) at org.python.core.imp.load(imp.java:357) at org.python.core.imp.load(imp.java:376) at org.python.core.imp.importName(imp.java:447) at org.python.core.imp.importName(imp.java:509) at org.python.core.ImportFunction.load(__builtin__.java:967) at org.python.core.ImportFunction.__call__(__builtin__.java:961) at org.python.core.PyObject.__call__(PyObject.java:250) at org.python.core.__builtin__.__import__(__builtin__.java:921) at org.python.core.imp.importOne(imp.java:518) at MicroscopeApplet$_PyInner.main$6(MicroscopeApplet.java:111) at MicroscopeApplet$_PyInner.call_function(MicroscopeApplet.java:62) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.imp.createFromCode(imp.java:157) at org.python.core.Py.initProxy(Py.java:731) at MicroscopeApplet.<init>(MicroscopeApplet.java:247) at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Class.java:237) at sun.applet.AppletPanel.createApplet(AppletPanel.java:579) at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1178) at sun.applet.AppletPanel.runLoader(AppletPanel.java:515) at sun.applet.AppletPanel.run(AppletPanel.java:293) at sun.plugin.navig.motif.MotifAppletViewer.maf_run(MotifAppletViewer.java:127) at sun.plugin.navig.motif.MotifAppletViewer.run(MotifAppletViewer.java:123) at java.lang.Thread.run(Thread.java:484) Traceback (innermost last): File "/home/akuchlin/src/mems/proto3/instrument/client/awt/MicroscopeApplet.py", line 0, in main File "/home/akuchlin/src/mems/proto3/instrument/client/awt/PyClient.py", line 0, in main File "/usr/local/jython-2.0/Lib/string.py", line 0, in main java.lang.ClassFormatError: strop (Bad magic number) |
From: Duane <dpk...@ur...> - 2001-12-17 22:05:55
|
I'd like to jar up my py files (or *$py.class files) into one jar and = jump into my application with Java Web Start. With Java Web start, you = can only specify jar files, not py files. I cannot use the python.path = since Web Start renames the jar files and puts them in an unknown = location. Is there a way to make jython get the py files using = Class.getResource() instead of looking locally for a file? That could = be usefull for standard applications as well. |
From: Guillaume R. <ro...@cc...> - 2001-12-17 16:16:40
|
Ainsi parlait Finn Bock : > [Guillaume Rousse] > > >I can't currently download jython 2.0 source from CVS > >cvs -z3 -d:pserver:ano...@cv...:/cvsroot/jython co > > -r Release_2_0 jython > >cvs [server aborted]: linefeed expected in > >/cvsroot/jython/jython/org/python/core/Java2Accessibility.java,v > > This is fixed now. [sweet fate, I hope its fixed!] It is, thanks ! > >BTW, i understand some people are happy with auto-installers, but this is > >really unpractical for people wanting to package it. Why don't you provide > >standard source and binary tarballs along ? > > More work, little return (for me). I can't recall any previous request > for a such formats. After all, the .class file is a valid .zip file. You're right, i didn't knew. However, it is still a mixed (source + binaries) release, so i'll stay with CVS. -- Guillaume Rousse <ro...@cc...> GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html |
From: Samuele P. <ped...@bl...> - 2001-12-17 16:13:41
|
Hi. If you're exec statements repeatedely create new classes inheriting from java, you could see memory leaks if you don't set the described option. You can check for that running your applet under the appletviewer and passing either -verbose:gc (jdk <1.3) or -verbose:class (jdk >= 1.3) to the java runtime with the -J option also -J-verbose:gc or .... And check whether the classes org.python.pycode._pyx* org.python.proxies.* dynamically created during an exec are unloaded after a while. Under jdk 1.3 a System.gc triggers also class unloading so you can add logic to the applet to trigger System.gc() for you tests. If they are not, setting the option should solve the problem, so I would redo the test with the option set to weak. Weak could have a slightly performance impact vs soft. On the other hand for debugging the problem weak is better, with weak gc force unloading, while soft will cause unloading only in case of low memory conditions. Only testing can tell you whether soft or weak is the right setting for production code wrt to performance. Anyway both should not have any kind of big impact unless your applet is very peculiar. AFAIK this is the only potential cause of leaks under Jython. Let us know if you cannot solve your problem or need further explanation. regards, Samuele Pedroni. ----- Original Message ----- From: Sells, Fred <fr...@ad...> To: <jyt...@li...> Sent: Monday, December 17, 2001 3:38 PM Subject: [Jython-users] memory leak > I have a memory leak in an applet that uses the Python.exec() method > multiple times. I though that would work since I overwrite the same Python > variable names with each invocation; however that is not the case. > contonious calls end up in a VM out of memory error > > the jython registry has the following entry. Will this solve my problem > (relating to memory leak :) )? Is there a difference between "soft" and > "weak"? > > # List of choices for internal tables impl (PyJavaClasses canonical map > etc.), > # these are separated through ':' and tryed from left to right. > # For long running applications under java2, needing classes unloading, > # in order to have jython runtime automatically discarding > # no longer needed info and avoding memory leakage, this can be set > # to weak or soft (=> an impl. using weak-refs or soft-refs will be used). > #python.options.internalTablesImpl = soft > #python.options.internalTablesImpl = weak > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Sells, F. <fr...@ad...> - 2001-12-17 14:53:14
|
I have a memory leak in an applet that uses the Python.exec() method multiple times. I though that would work since I overwrite the same Python variable names with each invocation; however that is not the case. contonious calls end up in a VM out of memory error the jython registry has the following entry. Will this solve my problem (relating to memory leak :) )? Is there a difference between "soft" and "weak"? # List of choices for internal tables impl (PyJavaClasses canonical map etc.), # these are separated through ':' and tryed from left to right. # For long running applications under java2, needing classes unloading, # in order to have jython runtime automatically discarding # no longer needed info and avoding memory leakage, this can be set # to weak or soft (=> an impl. using weak-refs or soft-refs will be used). #python.options.internalTablesImpl = soft #python.options.internalTablesImpl = weak |