You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <otm...@us...> - 2010-10-24 20:39:47
|
Revision: 7167 http://jython.svn.sourceforge.net/jython/?rev=7167&view=rev Author: otmarhumbel Date: 2010-10-24 20:39:41 +0000 (Sun, 24 Oct 2010) Log Message: ----------- fix the version in the welcome title Modified Paths: -------------- tags/Release_2_5_2rc2/jython/README.txt Modified: tags/Release_2_5_2rc2/jython/README.txt =================================================================== --- tags/Release_2_5_2rc2/jython/README.txt 2010-10-24 20:14:44 UTC (rev 7166) +++ tags/Release_2_5_2rc2/jython/README.txt 2010-10-24 20:39:41 UTC (rev 7167) @@ -1,4 +1,4 @@ -Welcome to Jython 2.5.2 rc1 +Welcome to Jython 2.5.2 rc2 =========================== This is the second release candidate of the 2.5.2 version of Jython. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-24 20:14:50
|
Revision: 7166 http://jython.svn.sourceforge.net/jython/?rev=7166&view=rev Author: otmarhumbel Date: 2010-10-24 20:14:44 +0000 (Sun, 24 Oct 2010) Log Message: ----------- tagging Release_2_5_2rc2 Added Paths: ----------- tags/Release_2_5_2rc2/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-24 20:10:39
|
Revision: 7165 http://jython.svn.sourceforge.net/jython/?rev=7165&view=rev Author: otmarhumbel Date: 2010-10-24 20:10:31 +0000 (Sun, 24 Oct 2010) Log Message: ----------- prepare for 2.5.2rc2 Modified Paths: -------------- trunk/jython/README.txt trunk/jython/build.xml Modified: trunk/jython/README.txt =================================================================== --- trunk/jython/README.txt 2010-10-22 03:01:56 UTC (rev 7164) +++ trunk/jython/README.txt 2010-10-24 20:10:31 UTC (rev 7165) @@ -1,8 +1,9 @@ Welcome to Jython 2.5.2 rc1 =========================== -This is the first release candidate of the 2.5.2 version of Jython. -We hope that this is the only release candidate of 2.5.2, but this +This is the second release candidate of the 2.5.2 version of Jython. +The major difference to rc1 is a fix for better IPython support. +We still hope that there won't be many more release candidates, but this will depend on bug reports. This release fixes bugs related to resource leaks, Java integration, Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2010-10-22 03:01:56 UTC (rev 7164) +++ trunk/jython/build.xml 2010-10-24 20:10:31 UTC (rev 7165) @@ -123,13 +123,13 @@ <property name="PY_RELEASE_LEVEL_SNAPSHOT" value="170"/> <!-- 0xAA --> <!-- The current version info --> - <property name="jython.version" value="2.5.2rc1"/> - <property name="jython.version.noplus" value="2.5.2rc1"/> + <property name="jython.version" value="2.5.2rc2"/> + <property name="jython.version.noplus" value="2.5.2rc2"/> <property name="jython.major_version" value="2"/> <property name="jython.minor_version" value="5"/> <property name="jython.micro_version" value="2"/> <property name="jython.release_level" value="${PY_RELEASE_LEVEL_GAMMA}"/> - <property name="jython.release_serial" value="1"/> + <property name="jython.release_serial" value="2"/> <condition property="do.snapshot.build"> <isset property="snapshot.revision" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-22 03:02:02
|
Revision: 7164 http://jython.svn.sourceforge.net/jython/?rev=7164&view=rev Author: zyasoft Date: 2010-10-22 03:01:56 +0000 (Fri, 22 Oct 2010) Log Message: ----------- More fixes of readline to support ipython Modified Paths: -------------- trunk/jython/Lib/readline.py Modified: trunk/jython/Lib/readline.py =================================================================== --- trunk/jython/Lib/readline.py 2010-10-22 01:40:30 UTC (rev 7163) +++ trunk/jython/Lib/readline.py 2010-10-22 03:01:56 UTC (rev 7164) @@ -21,12 +21,15 @@ _history_list = None -# the need for these warnings should go away once we update JLine +# The need for the following warnings should go away once we update +# JLine. Choosing ImportWarning as the closest warning to what is +# going on here, namely this is functionality not yet available on +# Jython. -class NotImplementedWarning(UserWarning): +class NotImplementedWarning(ImportWarning): """Not yet implemented by Jython""" -class SecurityWarning(UserWarning): +class SecurityWarning(ImportWarning): """Security manager prevents access to private field""" @@ -56,9 +59,9 @@ if java.lang.reflect.Array.getShort(keybindings, 9) != COMPLETE: java.lang.reflect.Array.setShort(keybindings, 9, COMPLETE) except: - warn("Cannot bind tab key to complete. You need to do this in a .jlinebindings.properties file instead", SecurityWarning) + warn("Cannot bind tab key to complete. You need to do this in a .jlinebindings.properties file instead", SecurityWarning, stacklevel=2) else: - warn("Cannot bind key %s. You need to do this in a .jlinebindings.properties file instead" % (string,), NotImplementedWarning) + warn("Cannot bind key %s. You need to do this in a .jlinebindings.properties file instead" % (string,), NotImplementedWarning, stacklevel=2) def get_line_buffer(): return str(_reader.cursorBuffer.buffer) @@ -67,11 +70,13 @@ _reader.putString(string) def read_init_file(filename=None): - warn("read_init_file: %s" % (filename,), NotImplementedWarning) + warn("read_init_file: %s" % (filename,), NotImplementedWarning, "module", 2) def read_history_file(filename="~/.history"): + print "Reading history:", filename expanded = os.path.expanduser(filename) new_history = _reader.getHistory().getClass()() + # new_history.clear() with open(expanded) as f: for line in f: new_history.addToHistory(line.rstrip()) @@ -83,6 +88,7 @@ with open(expanded, 'w') as f: for line in _reader.history.historyList: f.write(line) + f.write("\n") def clear_history(): _reader.history.clear() @@ -106,7 +112,7 @@ if _history_list: _history_list.remove(pos) else: - warn("Cannot remove history item at position: %s" % (pos,), SecurityWarning) + warn("Cannot remove history item at position: %s" % (pos,), SecurityWarning, stacklevel=2) def redisplay(): _reader.redrawLine() @@ -115,7 +121,7 @@ sys._jy_interpreter.startupHook = function def set_pre_input_hook(function=None): - warn("set_pre_input_hook %s" % (function,), NotImplementedWarning) + warn("set_pre_input_hook %s" % (function,), NotImplementedWarning, stacklevel=2) _completer_function = None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-22 01:40:41
|
Revision: 7163 http://jython.svn.sourceforge.net/jython/?rev=7163&view=rev Author: zyasoft Date: 2010-10-22 01:40:30 +0000 (Fri, 22 Oct 2010) Log Message: ----------- cPickle did not properly call import from Java, using null instead of Py.None for globals and locals. Thanks Anselm Kruis for the patch! Fixes #1648. Modified Paths: -------------- trunk/jython/Lib/test/test_cpickle_jy.py trunk/jython/NEWS trunk/jython/src/org/python/modules/cPickle.java Modified: trunk/jython/Lib/test/test_cpickle_jy.py =================================================================== --- trunk/jython/Lib/test/test_cpickle_jy.py 2010-10-22 01:13:48 UTC (rev 7162) +++ trunk/jython/Lib/test/test_cpickle_jy.py 2010-10-22 01:40:30 UTC (rev 7163) @@ -2,6 +2,8 @@ Made for Jython. """ +import __builtin__ +import sys import cPickle import pickle import unittest @@ -70,6 +72,25 @@ self.assertRaises(pickle.UnpicklingError, b_unpickler.load) + def testWithUserDefinedImport(self): + """test cPickle calling a user defined import function.""" + # This tests the fix for http://bugs.jython.org/issue1665 + # setup + original_import = __builtin__.__import__ + def import_hook(name, _globals=None, locals=None, fromlist=None, level= -1): + return original_import(name, _globals, locals, fromlist, level) + + # test + __builtin__.__import__ = import_hook + try: + if "no_such_module" in sys.modules: + del sys.modules["no_such_module"] # force cPickle to call __import__ + self.assertRaises(ImportError, cPickle.loads, pickle.GLOBAL + "no_such_module\n" + "no_such_class\n") + finally: + __builtin__.__import__ = original_import + + + def test_main(): test_support.run_unittest(CPickleTestCase) Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-22 01:13:48 UTC (rev 7162) +++ trunk/jython/NEWS 2010-10-22 01:40:30 UTC (rev 7163) @@ -2,7 +2,9 @@ Jython 2.5.2rc2 Bugs Fixed + - [ 1665 ] cPickle calls __import__ with illegal parameters - [ 1628 ] getpass.getpass echoes input + - Fix logic to detect that a console is interactive (related to #1133) Jython 2.5.2rc1 Bugs Fixed @@ -16,9 +18,8 @@ - [ 1452 ] pydoc help() function fails because sys.executable is None in stand-alone Jython - [ 1568 ] sys.stdout.encoding returns wrong value in Windows with Jython 2.5.1 (fixed on Java 6 only) - [ 1647 ] zxJDBC does not handle NVARCHAR + - SocketServer module now supports ephemeral server ports (by using port 0); see discussion for #1660 - SocketServer module now supports ephemeral server ports (by using port 0); see discussion for #1660 - Jython 2.5.2b2 Bugs Fixed - [ 1327 ] Classloaders cannot GC, which exhausts permgen (partial bug fix) Modified: trunk/jython/src/org/python/modules/cPickle.java =================================================================== --- trunk/jython/src/org/python/modules/cPickle.java 2010-10-22 01:13:48 UTC (rev 7162) +++ trunk/jython/src/org/python/modules/cPickle.java 2010-10-22 01:40:30 UTC (rev 7163) @@ -2245,7 +2245,7 @@ private static PyObject importModule(String name) { PyObject fromlist = new PyTuple(Py.newString("__doc__")); - return __builtin__.__import__(name, null, null, fromlist); + return __builtin__.__import__(name, Py.None, Py.None, fromlist); } private static PyObject getJavaFunc(String name, String methodName) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-22 01:13:54
|
Revision: 7162 http://jython.svn.sourceforge.net/jython/?rev=7162&view=rev Author: zyasoft Date: 2010-10-22 01:13:48 +0000 (Fri, 22 Oct 2010) Log Message: ----------- Uses JLine support, when available, to turn off echoing in getpass.getpass. Fixes #1628. Modified Paths: -------------- trunk/jython/Lib/getpass.py trunk/jython/NEWS Modified: trunk/jython/Lib/getpass.py =================================================================== --- trunk/jython/Lib/getpass.py 2010-10-19 03:02:51 UTC (rev 7161) +++ trunk/jython/Lib/getpass.py 2010-10-22 01:13:48 UTC (rev 7162) @@ -14,10 +14,37 @@ # Authors: Piers Lauder (original) # Guido van Rossum (Windows support and cleanup) +import os import sys __all__ = ["getpass","getuser"] +def jython_getpass(prompt='Password: ', stream=None): + """Prompt for a password, with echo turned off. + The prompt is written on stream, by default stdout. + + Restore terminal settings at end. + """ + if stream is None: + stream = sys.stdout + + try: + terminal = sys._jy_interpreter.reader.terminal + except: + return default_getpass(prompt) + + echoed = terminal.getEcho() + terminal.disableEcho() + try: + passwd = _raw_input(prompt, stream) + finally: + if echoed: + terminal.enableEcho() + + stream.write('\n') + return passwd + + def unix_getpass(prompt='Password: ', stream=None): """Prompt for a password, with echo turned off. The prompt is written on stream, by default stdout. @@ -99,8 +126,6 @@ """ - import os - for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'): user = os.environ.get(name) if user: @@ -123,7 +148,10 @@ try: from EasyDialogs import AskPassword except ImportError: - getpass = default_getpass + if os.name == 'java': + getpass = jython_getpass + else: + getpass = default_getpass else: getpass = AskPassword else: Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-19 03:02:51 UTC (rev 7161) +++ trunk/jython/NEWS 2010-10-22 01:13:48 UTC (rev 7162) @@ -1,5 +1,9 @@ Jython NEWS +Jython 2.5.2rc2 + Bugs Fixed + - [ 1628 ] getpass.getpass echoes input + Jython 2.5.2rc1 Bugs Fixed - [ 1133 ] Support ipython and other completers with readline emulation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-19 03:02:57
|
Revision: 7161 http://jython.svn.sourceforge.net/jython/?rev=7161&view=rev Author: zyasoft Date: 2010-10-19 03:02:51 +0000 (Tue, 19 Oct 2010) Log Message: ----------- Fixed test for console interactivity. This allows ipython and similar readline using scripts to run without -i. Modified Paths: -------------- trunk/jython/src/org/python/util/jython.java Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2010-10-18 02:19:18 UTC (rev 7160) +++ trunk/jython/src/org/python/util/jython.java 2010-10-19 03:02:51 UTC (rev 7161) @@ -157,7 +157,7 @@ PySystemState systemState = Py.getSystemState(); // Decide if stdin is interactive - if (!opts.fixInteractive && opts.interactive) { + if (!opts.fixInteractive || opts.interactive) { opts.interactive = ((PyFile)Py.defaultSystemState.stdin).isatty(); if (!opts.interactive) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-18 00:10:15
|
Revision: 7159 http://jython.svn.sourceforge.net/jython/?rev=7159&view=rev Author: otmarhumbel Date: 2010-10-18 00:10:09 +0000 (Mon, 18 Oct 2010) Log Message: ----------- a sketch for 2.5.2rc1 Modified Paths: -------------- trunk/website/index.txt trunk/website/redirects/downloads.txt trunk/website/redirects/latest.txt Modified: trunk/website/index.txt =================================================================== --- trunk/website/index.txt 2010-10-17 22:55:51 UTC (rev 7158) +++ trunk/website/index.txt 2010-10-18 00:10:09 UTC (rev 7159) @@ -4,6 +4,10 @@ Latest News ~~~~~~~~~~~ +**Jython 2.5.2 RC 1 Has Been Released** (October 18, 2010) + +The Jython development team would like to announce the release of 2.5.2 Release Candidate 1. For a complete listing of changes, please visit the `Release Notes`_. + **Jython 2.5.2 Beta 2 Has Been Released** (September 13, 2010) The Jython development team would like to announce the release of 2.5.2 Beta 2. For a complete listing of changes, please visit the `Release Notes`_. @@ -85,6 +89,7 @@ .. _this post: http://blog.springpython.webfactional.com/2009/10/15/see-how-spring-python-works-with-jython/ .. _Release Notes: http://www.jython.org/latest.html .. _the bug tracker: http://bugs.jython.org -.. _download the installer by clicking here: http://sourceforge.net/projects/jython/files/jython-dev/2.5.2b1/jython_installer-2.5.2b1.jar/download +.. _download the installer by clicking here: http://sourceforge.net/projects/jython/files/jython-dev/2.5.2rc1/jython_installer-2.5.2rc1.jar/download + Modified: trunk/website/redirects/downloads.txt =================================================================== --- trunk/website/redirects/downloads.txt 2010-10-17 22:55:51 UTC (rev 7158) +++ trunk/website/redirects/downloads.txt 2010-10-18 00:10:09 UTC (rev 7159) @@ -1,14 +1,14 @@ Downloads --------- -The current version of Jython is 2.5.2 - Beta 2, please use the link below to download the Java installer. +The current version of Jython is 2.5.2 - Release Candidate 1, please use the link below to download the Java installer. Once downloaded, please double-click on the JAR file to start the installation process. You may also want to read the `Installation instructions`_ or the `Release Notes`_. -`Download Jython 2.5.2`_ Beta 2 +`Download Jython 2.5.2`_ RC 1 -- MD5: ``560b43678059fd41a374a9487517235c`` -- SHA1: ``0c41db0e5d275bff80a2c4f9bc3de2e48969d0a6`` +- MD5: ``4067d89c58d5596ce85611b2defd0333`` +- SHA1: ``6545eda94e5f3a55cc392c59d1ffa683e094eca3`` Previous Releases ----------------- @@ -28,7 +28,7 @@ - MD5: ``774543534bef2d68247953882237d448`` - SHA1: ``6fea1e8985af955fc843789e2d60fcfc38a76fd8`` -.. _Download Jython 2.5.2: http://sourceforge.net/projects/jython/files/jython-dev/2.5.2b2/jython_installer-2.5.2b2.jar/download +.. _Download Jython 2.5.2: http://sourceforge.net/projects/jython/files/jython-dev/2.5.2rc1/jython_installer-2.5.2rc1.jar/download .. _Jython 2.5.1: http://sourceforge.net/projects/jython/files/jython/2.5.1/jython_installer-2.5.1.jar/download .. _Jython 2.5.0: http://sourceforge.net/projects/jython/files/jython/2.5.0/jython_installer-2.5.0.jar/download .. _Jython 2.2.1: http://sourceforge.net/projects/jython/files/jython/jython_installer-2.2.1.jar Modified: trunk/website/redirects/latest.txt =================================================================== --- trunk/website/redirects/latest.txt 2010-10-17 22:55:51 UTC (rev 7158) +++ trunk/website/redirects/latest.txt 2010-10-18 00:10:09 UTC (rev 7159) @@ -6,6 +6,20 @@ Bugs Fixed ---------- +2.5.2-rc1 +~~~~~~~~~ + - [ 1133 ] Support ipython and other completers with readline emulation + - [ 1642 ] JSR223 PyScriptEngine#getInterface returns a NPE when called with zero args + - [ 1662 ] time.strptime does not use Java date format strings properly + - [ 1543 ] PyArray fails to clean up pre-allocated space + - [ 1661 ] Error at on exit in TCC/LE + - [ 1639 ] JBoss 5, vfszip protocol in use for jarFileName in PySystemState + - [ 1660 ] threading module memory leak + - [ 1452 ] pydoc help() function fails because sys.executable is None in stand-alone Jython + - [ 1568 ] sys.stdout.encoding returns wrong value in Windows with Jython 2.5.1 (fixed on Java 6 only) + - [ 1647 ] zxJDBC does not handle NVARCHAR + - SocketServer module now supports ephemeral server ports (by using port 0); see discussion for #1660 + 2.5.2-b2 ~~~~~~~~ - [ 1327 ] Classloaders cannot GC, which exhausts permgen (partial bug fix) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-17 22:55:57
|
Revision: 7158 http://jython.svn.sourceforge.net/jython/?rev=7158&view=rev Author: otmarhumbel Date: 2010-10-17 22:55:51 +0000 (Sun, 17 Oct 2010) Log Message: ----------- tagging Release_2_5_2rc1 Added Paths: ----------- tags/Release_2_5_2rc1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-17 22:52:16
|
Revision: 7157 http://jython.svn.sourceforge.net/jython/?rev=7157&view=rev Author: otmarhumbel Date: 2010-10-17 22:52:09 +0000 (Sun, 17 Oct 2010) Log Message: ----------- prepare for 2.5.2rc1 Modified Paths: -------------- trunk/jython/README.txt trunk/jython/build.xml Modified: trunk/jython/README.txt =================================================================== --- trunk/jython/README.txt 2010-10-17 22:26:38 UTC (rev 7156) +++ trunk/jython/README.txt 2010-10-17 22:52:09 UTC (rev 7157) @@ -1,8 +1,8 @@ -Welcome to Jython 2.5.2 Beta2 -============================= +Welcome to Jython 2.5.2 rc1 +=========================== -This is the second beta release of the 2.5.2 version of Jython. Our -current plans is that this will be the last beta of 2.5.2, but this +This is the first release candidate of the 2.5.2 version of Jython. +We hope that this is the only release candidate of 2.5.2, but this will depend on bug reports. This release fixes bugs related to resource leaks, Java integration, Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2010-10-17 22:26:38 UTC (rev 7156) +++ trunk/jython/build.xml 2010-10-17 22:52:09 UTC (rev 7157) @@ -123,13 +123,13 @@ <property name="PY_RELEASE_LEVEL_SNAPSHOT" value="170"/> <!-- 0xAA --> <!-- The current version info --> - <property name="jython.version" value="2.5.2b2"/> - <property name="jython.version.noplus" value="2.5.2b2"/> + <property name="jython.version" value="2.5.2rc1"/> + <property name="jython.version.noplus" value="2.5.2rc1"/> <property name="jython.major_version" value="2"/> <property name="jython.minor_version" value="5"/> <property name="jython.micro_version" value="2"/> - <property name="jython.release_level" value="${PY_RELEASE_LEVEL_BETA}"/> - <property name="jython.release_serial" value="2"/> + <property name="jython.release_level" value="${PY_RELEASE_LEVEL_GAMMA}"/> + <property name="jython.release_serial" value="1"/> <condition property="do.snapshot.build"> <isset property="snapshot.revision" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-17 22:26:44
|
Revision: 7156 http://jython.svn.sourceforge.net/jython/?rev=7156&view=rev Author: otmarhumbel Date: 2010-10-17 22:26:38 +0000 (Sun, 17 Oct 2010) Log Message: ----------- enable installation autotests if there is a warning about the os Modified Paths: -------------- trunk/installer/src/java/org/python/util/install/Installation.java trunk/installer/src/java/org/python/util/install/driver/InstallationDriver.java Modified: trunk/installer/src/java/org/python/util/install/Installation.java =================================================================== --- trunk/installer/src/java/org/python/util/install/Installation.java 2010-10-17 17:59:35 UTC (rev 7155) +++ trunk/installer/src/java/org/python/util/install/Installation.java 2010-10-17 22:26:38 UTC (rev 7156) @@ -71,7 +71,7 @@ _textConstants = ResourceBundle.getBundle(RESOURCE_CLASS, locale); } - protected static boolean isValidOs() { + public static boolean isValidOs() { String osName = System.getProperty(OS_NAME, ""); String lowerOs = osName.toLowerCase(); if (isWindows()) { Modified: trunk/installer/src/java/org/python/util/install/driver/InstallationDriver.java =================================================================== --- trunk/installer/src/java/org/python/util/install/driver/InstallationDriver.java 2010-10-17 17:59:35 UTC (rev 7155) +++ trunk/installer/src/java/org/python/util/install/driver/InstallationDriver.java 2010-10-17 22:26:38 UTC (rev 7156) @@ -188,12 +188,7 @@ test1.addAnswer("3"); // type: minimum test1.addAnswer("n"); // include: nothing test1.addAnswer(test1.getTargetDir().getAbsolutePath()); // target directory - JavaHomeHandler javaHomeHandler = test1.getJavaHomeHandler(); - if (javaHomeHandler.isDeviation() && javaHomeHandler.isValidHome()) { - test1.addAnswer(javaHomeHandler.getHome().getAbsolutePath()); // different jre - } else { - test1.addAnswer(ConsoleInstaller.CURRENT_JRE); - } + addJavaAndOSAnswers(test1); test1.addAnswer("y"); // confirm copying test1.addAnswer("n"); // no readme test1.setVerifier(new NormalVerifier()); @@ -215,12 +210,7 @@ test2.addAnswer("wrongAnswer"); // wrong answer test2.addAnswer("n"); // no further excludes test2.addAnswer(test2.getTargetDir().getAbsolutePath()); // target directory - javaHomeHandler = test2.getJavaHomeHandler(); - if (javaHomeHandler.isDeviation() && javaHomeHandler.isValidHome()) { - test2.addAnswer(javaHomeHandler.getHome().getAbsolutePath()); // different jre - } else { - test2.addAnswer(ConsoleInstaller.CURRENT_JRE); - } + addJavaAndOSAnswers(test2); test2.addAnswer("y"); // confirm copying test2.addAnswer("n"); // no readme test2.setVerifier(new NormalVerifier()); @@ -233,12 +223,7 @@ test3.addAnswer("y"); // accept license test3.addAnswer("9"); // type: standalone test3.addAnswer(test3.getTargetDir().getAbsolutePath()); // target directory - javaHomeHandler = test3.getJavaHomeHandler(); - if (javaHomeHandler.isDeviation() && javaHomeHandler.isValidHome()) { - test3.addAnswer(javaHomeHandler.getHome().getAbsolutePath()); // different jre - } else { - test3.addAnswer(ConsoleInstaller.CURRENT_JRE); - } + addJavaAndOSAnswers(test3); test3.addAnswer("y"); // confirm copying test3.addAnswer("n"); // no readme test3.setVerifier(new StandaloneVerifier()); @@ -255,12 +240,7 @@ test4.addAnswer("y"); // exclude test4.addAnswer("n"); // no further excludes test4.addAnswer(test4.getTargetDir().getAbsolutePath()); // target directory - javaHomeHandler = test4.getJavaHomeHandler(); - if (javaHomeHandler.isDeviation() && javaHomeHandler.isValidHome()) { - test4.addAnswer(javaHomeHandler.getHome().getAbsolutePath()); // different jre - } else { - test4.addAnswer(ConsoleInstaller.CURRENT_JRE); - } + addJavaAndOSAnswers(test4); test4.addAnswer("y"); // confirm copying test4.addAnswer("n"); // no readme test4.setVerifier(new NormalVerifier()); @@ -275,6 +255,18 @@ } } + private void addJavaAndOSAnswers(ConsoleAutotest test) { + JavaHomeHandler javaHomeHandler = test.getJavaHomeHandler(); + if (javaHomeHandler.isDeviation() && javaHomeHandler.isValidHome()) { + test.addAnswer(javaHomeHandler.getHome().getAbsolutePath()); // different jre + } else { + test.addAnswer(ConsoleInstaller.CURRENT_JRE); + } + if (!Installation.isValidOs()) { + test.addAnswer(""); // enter to proceed anyway + } + } + /** * build all the gui tests * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-17 17:59:41
|
Revision: 7155 http://jython.svn.sourceforge.net/jython/?rev=7155&view=rev Author: zyasoft Date: 2010-10-17 17:59:35 +0000 (Sun, 17 Oct 2010) Log Message: ----------- Updated NEWS re ipython/completer support Modified Paths: -------------- trunk/jython/NEWS Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-17 16:59:06 UTC (rev 7154) +++ trunk/jython/NEWS 2010-10-17 17:59:35 UTC (rev 7155) @@ -2,6 +2,7 @@ Jython 2.5.2rc1 Bugs Fixed + - [ 1133 ] Support ipython and other completers with readline emulation - [ 1642 ] JSR223 PyScriptEngine#getInterface returns a NPE when called with zero args - [ 1662 ] time.strptime does not use Java date format strings properly - [ 1543 ] PyArray fails to clean up pre-allocated space This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-17 16:59:42
|
Revision: 7154 http://jython.svn.sourceforge.net/jython/?rev=7154&view=rev Author: zyasoft Date: 2010-10-17 16:59:06 +0000 (Sun, 17 Oct 2010) Log Message: ----------- Added support for readline.parse_and_bind('tab: complete') through reflection, to avoid user setup issues with alternative key binding files. This completes work on #1133. We should revisit by pushing the features implemented by reflection on JLine into JLine itself, however. Modified Paths: -------------- trunk/jython/Lib/readline.py Modified: trunk/jython/Lib/readline.py =================================================================== --- trunk/jython/Lib/readline.py 2010-10-17 04:51:15 UTC (rev 7153) +++ trunk/jython/Lib/readline.py 2010-10-17 16:59:06 UTC (rev 7154) @@ -1,98 +1,121 @@ from __future__ import with_statement import os.path import sys +from warnings import warn +import java.lang.reflect.Array + +__all__ = ['add_history', 'clear_history', 'get_begidx', 'get_completer', + 'get_completer_delims', 'get_current_history_length', + 'get_endidx', 'get_history_item', 'get_history_length', + 'get_line_buffer', 'insert_text', 'parse_and_bind', + 'read_history_file', 'read_init_file', 'redisplay', + 'remove_history_item', 'set_completer', 'set_completer_delims', + 'set_history_length', 'set_pre_input_hook', 'set_startup_hook', + 'write_history_file'] + try: - reader = sys._jy_interpreter.reader + _reader = sys._jy_interpreter.reader except AttributeError: raise ImportError("Cannot access JLineConsole") -history_list = None +_history_list = None +# the need for these warnings should go away once we update JLine + +class NotImplementedWarning(UserWarning): + """Not yet implemented by Jython""" + +class SecurityWarning(UserWarning): + """Security manager prevents access to private field""" + + def _setup_history(): # This is obviously not desirable, but avoids O(n) workarounds to # modify the history (ipython uses the function # remove_history_item to mutate the history relatively frequently) - global history_list + global _history_list - history = reader.history + history = _reader.history try: history_list_field = history.class.getDeclaredField("history") history_list_field.setAccessible(True) - history_list = history_list_field.get(history) + _history_list = history_list_field.get(history) except: pass _setup_history() def parse_and_bind(string): - # TODO this should probably reinitialize the reader, if possible - # with any desired settings; this will require some more work to implement + if string == "tab: complete": + try: + keybindings_field = _reader.class.getDeclaredField("keybindings") + keybindings_field.setAccessible(True) + keybindings = keybindings_field.get(_reader) + COMPLETE = _reader.KEYMAP_NAMES.get('COMPLETE') + if java.lang.reflect.Array.getShort(keybindings, 9) != COMPLETE: + java.lang.reflect.Array.setShort(keybindings, 9, COMPLETE) + except: + warn("Cannot bind tab key to complete. You need to do this in a .jlinebindings.properties file instead", SecurityWarning) + else: + warn("Cannot bind key %s. You need to do this in a .jlinebindings.properties file instead" % (string,), NotImplementedWarning) - # most importantly, need to support at least - # readline.parse_and_bind("tab: complete") - # but it's possible we can readily support other aspects of a readline file - - # XXX first time through, print a warning message about the required setup - # with jline properties (or potentially test...) - pass - def get_line_buffer(): - return str(reader.cursorBuffer.buffer) + return str(_reader.cursorBuffer.buffer) def insert_text(string): - reader.putString(string) + _reader.putString(string) def read_init_file(filename=None): - print "Not implemented: read_init_file", filename + warn("read_init_file: %s" % (filename,), NotImplementedWarning) def read_history_file(filename="~/.history"): expanded = os.path.expanduser(filename) - new_history = reader.getHistory().getClass()() + new_history = _reader.getHistory().getClass()() with open(expanded) as f: for line in f: new_history.addToHistory(line.rstrip()) - reader.history = new_history + _reader.history = new_history _setup_history() def write_history_file(filename="~/.history"): expanded = os.path.expanduser(filename) with open(expanded, 'w') as f: - for line in reader.history.historyList: + for line in _reader.history.historyList: f.write(line) def clear_history(): - reader.history.clear() + _reader.history.clear() def add_history(line): - reader.addToHistory(line) + _reader.addToHistory(line) def get_history_length(): - return reader.history.maxSize + return _reader.history.maxSize def set_history_length(length): - reader.history.maxSize = length + _reader.history.maxSize = length def get_current_history_length(): - return len(reader.history.historyList) + return len(_reader.history.historyList) def get_history_item(index): - return reader.history.historyList[index] + return _reader.history.historyList[index] def remove_history_item(pos): - if history_list: - history_list.remove(pos) + if _history_list: + _history_list.remove(pos) else: - print "Cannot remove history item at position:", pos + warn("Cannot remove history item at position: %s" % (pos,), SecurityWarning) def redisplay(): - reader.redrawLine() + _reader.redrawLine() def set_startup_hook(function=None): sys._jy_interpreter.startupHook = function def set_pre_input_hook(function=None): - print "Not implemented: set_pre_input_hook", function + warn("set_pre_input_hook %s" % (function,), NotImplementedWarning) _completer_function = None @@ -121,7 +144,7 @@ break return start - reader.addCompletor(complete_handler) + _reader.addCompletor(complete_handler) def get_completer(): @@ -136,10 +159,10 @@ return start, cursor def get_begidx(): - return _get_delimited(str(reader.cursorBuffer.buffer), reader.cursorBuffer.cursor)[0] + return _get_delimited(str(_reader.cursorBuffer.buffer), _reader.cursorBuffer.cursor)[0] def get_endidx(): - return _get_delimited(str(reader.cursorBuffer.buffer), reader.cursorBuffer.cursor)[1] + return _get_delimited(str(_reader.cursorBuffer.buffer), _reader.cursorBuffer.cursor)[1] def set_completer_delims(string): global _completer_delims, _completer_delims_set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-17 04:51:22
|
Revision: 7153 http://jython.svn.sourceforge.net/jython/?rev=7153&view=rev Author: zyasoft Date: 2010-10-17 04:51:15 +0000 (Sun, 17 Oct 2010) Log Message: ----------- Modified readline, specifically completion support and various hooks, so that it supports ipython 0.10.1 (with a minor patch on os.name in that codebase). Still requires user to provide an alternative properties file, that should be fixed before RC1. Fixes #1133. Modified Paths: -------------- trunk/jython/Lib/readline.py trunk/jython/src/org/python/util/JLineConsole.java Modified: trunk/jython/Lib/readline.py =================================================================== --- trunk/jython/Lib/readline.py 2010-10-16 16:15:33 UTC (rev 7152) +++ trunk/jython/Lib/readline.py 2010-10-17 04:51:15 UTC (rev 7153) @@ -7,6 +7,24 @@ except AttributeError: raise ImportError("Cannot access JLineConsole") +history_list = None + +def _setup_history(): + # This is obviously not desirable, but avoids O(n) workarounds to + # modify the history (ipython uses the function + # remove_history_item to mutate the history relatively frequently) + global history_list + + history = reader.history + try: + history_list_field = history.class.getDeclaredField("history") + history_list_field.setAccessible(True) + history_list = history_list_field.get(history) + except: + pass + +_setup_history() + def parse_and_bind(string): # TODO this should probably reinitialize the reader, if possible # with any desired settings; this will require some more work to implement @@ -14,24 +32,28 @@ # most importantly, need to support at least # readline.parse_and_bind("tab: complete") # but it's possible we can readily support other aspects of a readline file + + # XXX first time through, print a warning message about the required setup + # with jline properties (or potentially test...) pass def get_line_buffer(): - return str(reader.cursorBuffer.buffer) # or use toString to get unicode? + return str(reader.cursorBuffer.buffer) def insert_text(string): reader.putString(string) def read_init_file(filename=None): - pass + print "Not implemented: read_init_file", filename def read_history_file(filename="~/.history"): expanded = os.path.expanduser(filename) new_history = reader.getHistory().getClass()() with open(expanded) as f: for line in f: - new_history.addToHistory(line) + new_history.addToHistory(line.rstrip()) reader.history = new_history + _setup_history() def write_history_file(filename="~/.history"): expanded = os.path.expanduser(filename) @@ -42,6 +64,9 @@ def clear_history(): reader.history.clear() +def add_history(line): + reader.addToHistory(line) + def get_history_length(): return reader.history.maxSize @@ -55,23 +80,22 @@ return reader.history.historyList[index] def remove_history_item(pos): - # TODO possible? - raise Exception("not implemented") + if history_list: + history_list.remove(pos) + else: + print "Cannot remove history item at position:", pos def redisplay(): reader.redrawLine() def set_startup_hook(function=None): - # TODO add - pass - + sys._jy_interpreter.startupHook = function + def set_pre_input_hook(function=None): - # TODO add - pass + print "Not implemented: set_pre_input_hook", function +_completer_function = None -_completion_function = None - def set_completer(function=None): """set_completer([function]) -> None Set or remove the completer function. @@ -79,42 +103,50 @@ for state in 0, 1, 2, ..., until it returns a non-string. It should return the next possible completion starting with 'text'.""" - _completion_function = function + global _completer_function + _completer_function = function def complete_handler(buffer, cursor, candidates): + start = _get_delimited(buffer, cursor)[0] + delimited = buffer[start:cursor] for state in xrange(100): # TODO arbitrary, what's the number used by gnu readline? completion = None try: - completion = function(buffer[:cursor], state) + completion = function(delimited, state) except: pass if completion: candidates.add(completion) else: break - return 0 + return start reader.addCompletor(complete_handler) def get_completer(): - return _completion_function + return _completer_function +def _get_delimited(buffer, cursor): + start = cursor + for i in xrange(cursor-1, -1, -1): + if buffer[i] in _completer_delims: + break + start = i + return start, cursor + def get_begidx(): - # TODO add - pass + return _get_delimited(str(reader.cursorBuffer.buffer), reader.cursorBuffer.cursor)[0] def get_endidx(): - # TODO add - pass + return _get_delimited(str(reader.cursorBuffer.buffer), reader.cursorBuffer.cursor)[1] def set_completer_delims(string): - pass + global _completer_delims, _completer_delims_set + _completer_delims = string + _completer_delims_set = set(string) def get_completer_delims(): - pass + return _completer_delims -def add_history(line): - reader.addToHistory(line) - - +set_completer_delims(' \t\n`~!@#$%^&*()-=+[{]}\\|;:\'",<>/?') Modified: trunk/jython/src/org/python/util/JLineConsole.java =================================================================== --- trunk/jython/src/org/python/util/JLineConsole.java 2010-10-16 16:15:33 UTC (rev 7152) +++ trunk/jython/src/org/python/util/JLineConsole.java 2010-10-17 04:51:15 UTC (rev 7153) @@ -32,6 +32,11 @@ /** Main interface to JLine. */ protected ConsoleReader reader; + /** Set by readline.set_startup_hook */ + protected PyObject startup_hook; + + protected PyObject pre_input_hook; + /** Whether reader is a WindowsTerminal. */ private boolean windows; @@ -116,6 +121,13 @@ while (true) { try { + if (startup_hook != null) { + try { + startup_hook.__call__(); + } catch (Exception ex) { + System.err.println(ex); + } + } line = reader.readLine(promptString); break; } catch (IOException ioe) { @@ -163,4 +175,19 @@ public ConsoleReader getReader() { return reader; } + + + /** + * @return the startup hook (called prior to each readline) + */ + public PyObject getStartupHook() { + return startup_hook; + } + + /** + * Sets the startup hook (called prior to each readline) + */ + public void setStartupHook(PyObject hook) { + startup_hook = hook; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-16 16:15:39
|
Revision: 7152 http://jython.svn.sourceforge.net/jython/?rev=7152&view=rev Author: zyasoft Date: 2010-10-16 16:15:33 +0000 (Sat, 16 Oct 2010) Log Message: ----------- Fixed case where an uninitialized module (without __dict__ defined) would not work properly for PyModule#__findattr_ex__ (which was introduced for #1653). Restores Jython's behavior of propagating null for such attribute lookups in in its Java API. Modified Paths: -------------- trunk/jython/src/org/python/core/PyModule.java Modified: trunk/jython/src/org/python/core/PyModule.java =================================================================== --- trunk/jython/src/org/python/core/PyModule.java 2010-10-16 05:15:00 UTC (rev 7151) +++ trunk/jython/src/org/python/core/PyModule.java 2010-10-16 16:15:33 UTC (rev 7152) @@ -81,6 +81,9 @@ } protected PyObject impAttr(String name) { + if (__dict__ == null) { + return null; + } PyObject path = __dict__.__finditem__("__path__"); PyObject pyName = __dict__.__finditem__("__name__"); if (path == null || pyName == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-16 05:15:06
|
Revision: 7151 http://jython.svn.sourceforge.net/jython/?rev=7151&view=rev Author: zyasoft Date: 2010-10-16 05:15:00 +0000 (Sat, 16 Oct 2010) Log Message: ----------- Re-enable mixing Java and Python code in the same directory without explicit import via __init__.py. This allows for both import semantics. Still needs appropriate automated testing. Fixes #1653. Thanks babelmania for the patch! Modified Paths: -------------- trunk/jython/src/org/python/core/PyModule.java Modified: trunk/jython/src/org/python/core/PyModule.java =================================================================== --- trunk/jython/src/org/python/core/PyModule.java 2010-10-16 05:12:18 UTC (rev 7150) +++ trunk/jython/src/org/python/core/PyModule.java 2010-10-16 05:15:00 UTC (rev 7151) @@ -116,6 +116,14 @@ return null; } + @Override + public PyObject __findattr_ex__(String name) { + PyObject attr=super.__findattr_ex__(name); + if (attr!=null) + return attr; + return impAttr(name); + } + public void __setattr__(String name, PyObject value) { module___setattr__(name, value); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-16 05:12:24
|
Revision: 7150 http://jython.svn.sourceforge.net/jython/?rev=7150&view=rev Author: zyasoft Date: 2010-10-16 05:12:18 +0000 (Sat, 16 Oct 2010) Log Message: ----------- Hardened completion sso it doesn't fail on missing symbols. Modified Paths: -------------- trunk/jython/Lib/readline.py Modified: trunk/jython/Lib/readline.py =================================================================== --- trunk/jython/Lib/readline.py 2010-10-16 03:07:47 UTC (rev 7149) +++ trunk/jython/Lib/readline.py 2010-10-16 05:12:18 UTC (rev 7150) @@ -1,30 +1,17 @@ -""" Emulate module 'readline' from CPython. -We are using the JavaReadline JNI wrapper for GNU readline. - -2004-10-27, mar...@rw... - -""" - from __future__ import with_statement import os.path import sys -# XXX move to _jline_readline.py, just like our _gnu_readline.py (which is orphaned) -# then simply try successive imports to see what is installed - -# XXX what's oru character encoding issues here, if any? - try: reader = sys._jy_interpreter.reader - #from JLine import Completor except AttributeError: raise ImportError("Cannot access JLineConsole") def parse_and_bind(string): - # XXX this should probably reinitialize the reader, if possible + # TODO this should probably reinitialize the reader, if possible # with any desired settings; this will require some more work to implement - # most importantly, need to support + # most importantly, need to support at least # readline.parse_and_bind("tab: complete") # but it's possible we can readily support other aspects of a readline file pass @@ -68,33 +55,39 @@ return reader.history.historyList[index] def remove_history_item(pos): + # TODO possible? raise Exception("not implemented") def redisplay(): - reader.drawLine() # XXX not certain + reader.redrawLine() def set_startup_hook(function=None): + # TODO add pass def set_pre_input_hook(function=None): + # TODO add pass _completion_function = None def set_completer(function=None): - # XXX single method interface, http://jline.sourceforge.net/apidocs/jline/Completor.html - # just need to figure out what's necessary to adapt to Python's convention, - # but it should be fine :) + """set_completer([function]) -> None + Set or remove the completer function. + The function is called as function(text, state), + for state in 0, 1, 2, ..., until it returns a non-string. + It should return the next possible completion starting with 'text'.""" - """The completer method is called as completerclass.completer(text, state), for state in 0, 1, 2, ..., - until it returns a non-string value. It should return the next possible completion starting with text.""" - _completion_function = function def complete_handler(buffer, cursor, candidates): - for state in xrange(100): - completion = function(buffer[:cursor], state) + for state in xrange(100): # TODO arbitrary, what's the number used by gnu readline? + completion = None + try: + completion = function(buffer[:cursor], state) + except: + pass if completion: candidates.add(completion) else: @@ -108,9 +101,11 @@ return _completion_function def get_begidx(): + # TODO add pass def get_endidx(): + # TODO add pass def set_completer_delims(string): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-16 03:07:53
|
Revision: 7149 http://jython.svn.sourceforge.net/jython/?rev=7149&view=rev Author: zyasoft Date: 2010-10-16 03:07:47 +0000 (Sat, 16 Oct 2010) Log Message: ----------- Updated NEWS re #1642 Modified Paths: -------------- trunk/jython/NEWS Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-16 03:04:21 UTC (rev 7148) +++ trunk/jython/NEWS 2010-10-16 03:07:47 UTC (rev 7149) @@ -2,6 +2,7 @@ Jython 2.5.2rc1 Bugs Fixed + - [ 1642 ] JSR223 PyScriptEngine#getInterface returns a NPE when called with zero args - [ 1662 ] time.strptime does not use Java date format strings properly - [ 1543 ] PyArray fails to clean up pre-allocated space - [ 1661 ] Error at on exit in TCC/LE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-16 03:04:27
|
Revision: 7148 http://jython.svn.sourceforge.net/jython/?rev=7148&view=rev Author: zyasoft Date: 2010-10-16 03:04:21 +0000 (Sat, 16 Oct 2010) Log Message: ----------- Added test for #1662 re strptime properly quoting ending literals. Modified Paths: -------------- trunk/jython/NEWS Added Paths: ----------- trunk/jython/Lib/test/test_strptime_jy.py Added: trunk/jython/Lib/test/test_strptime_jy.py =================================================================== --- trunk/jython/Lib/test/test_strptime_jy.py (rev 0) +++ trunk/jython/Lib/test/test_strptime_jy.py 2010-10-16 03:04:21 UTC (rev 7148) @@ -0,0 +1,23 @@ +# merge into upstream test_strptime.py at some point + +import unittest +from datetime import datetime +from test import test_support + + +class ParsingTests(unittest.TestCase): + + def test_iso8601(self): + now = datetime.utcnow().replace(microsecond=0) + self.assertEqual(now, datetime.strptime(now.isoformat('T'), "%Y-%m-%dT%H:%M:%S")) + # tests bug 1662 + self.assertEqual(now, datetime.strptime(now.isoformat('T') + 'Z', "%Y-%m-%dT%H:%M:%SZ")) + +def test_main(): + test_support.run_unittest( + ParsingTests + ) + + +if __name__ == '__main__': + test_main() Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-16 02:55:32 UTC (rev 7147) +++ trunk/jython/NEWS 2010-10-16 03:04:21 UTC (rev 7148) @@ -2,6 +2,7 @@ Jython 2.5.2rc1 Bugs Fixed + - [ 1662 ] time.strptime does not use Java date format strings properly - [ 1543 ] PyArray fails to clean up pre-allocated space - [ 1661 ] Error at on exit in TCC/LE - [ 1639 ] JBoss 5, vfszip protocol in use for jarFileName in PySystemState This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2010-10-16 02:55:38
|
Revision: 7147 http://jython.svn.sourceforge.net/jython/?rev=7147&view=rev Author: zyasoft Date: 2010-10-16 02:55:32 +0000 (Sat, 16 Oct 2010) Log Message: ----------- The underlying array used by PyArray allocates extra space when extended, in case there will be future extension, much like the support in list. (AbstractArray in fact used to be used by list.) However, PyArray.__tojava__ needed to shrink the array when unboxing as a regular Java array. Resolved by simply copying when size != capacity. Fixes 1543. Modified Paths: -------------- trunk/jython/Lib/test/test_array_jy.py trunk/jython/NEWS trunk/jython/src/org/python/core/PyArray.java Modified: trunk/jython/Lib/test/test_array_jy.py =================================================================== --- trunk/jython/Lib/test/test_array_jy.py 2010-10-14 12:46:59 UTC (rev 7146) +++ trunk/jython/Lib/test/test_array_jy.py 2010-10-16 02:55:32 UTC (rev 7147) @@ -47,7 +47,15 @@ Color.RGBtoHSB(0, 255, 255, hsb1) self.assertEqual(hsb, hsb1, "hsb float arrays were not equal") + def test_java_roundtrip(self): + # bug 1543 + from java.lang import Object + x = array(Object, [0,1,2]) + x.append(3) + y = array(Object, [x]) # forces an implicit __tojava__ + self.assertEqual(x, y[0], "Did not shrink to fit") + class ToFromfileTestCase(unittest.TestCase): def tearDown(self): Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-14 12:46:59 UTC (rev 7146) +++ trunk/jython/NEWS 2010-10-16 02:55:32 UTC (rev 7147) @@ -2,6 +2,7 @@ Jython 2.5.2rc1 Bugs Fixed + - [ 1543 ] PyArray fails to clean up pre-allocated space - [ 1661 ] Error at on exit in TCC/LE - [ 1639 ] JBoss 5, vfszip protocol in use for jarFileName in PySystemState - [ 1660 ] threading module memory leak Modified: trunk/jython/src/org/python/core/PyArray.java =================================================================== --- trunk/jython/src/org/python/core/PyArray.java 2010-10-14 12:46:59 UTC (rev 7146) +++ trunk/jython/src/org/python/core/PyArray.java 2010-10-16 02:55:32 UTC (rev 7147) @@ -412,7 +412,13 @@ public Object __tojava__(Class<?> c) { if(c == Object.class || (c.isArray() && c.getComponentType().isAssignableFrom(type))) { - return data; + if (delegate.capacity != delegate.size) { + // when unboxing, need to shrink the array first, otherwise incorrect + // results to Java + return delegate.copyArray(); + } else { + return data; + } } if(c.isInstance(this)) return this; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-10 21:15:07
|
Revision: 7144 http://jython.svn.sourceforge.net/jython/?rev=7144&view=rev Author: otmarhumbel Date: 2010-10-10 21:15:01 +0000 (Sun, 10 Oct 2010) Log Message: ----------- adjust progress percentages Modified Paths: -------------- trunk/installer/src/java/org/python/util/install/JarInstaller.java Modified: trunk/installer/src/java/org/python/util/install/JarInstaller.java =================================================================== --- trunk/installer/src/java/org/python/util/install/JarInstaller.java 2010-10-10 11:36:05 UTC (rev 7143) +++ trunk/installer/src/java/org/python/util/install/JarInstaller.java 2010-10-10 21:15:01 UTC (rev 7144) @@ -95,7 +95,7 @@ // handle exclusion of directories Iterator<String> excludeDirsAsIterator = excludeDirs.iterator(); while (excludeDirsAsIterator.hasNext()) { - if (zipEntryName.startsWith((String)excludeDirsAsIterator.next() + if (zipEntryName.startsWith(excludeDirsAsIterator.next() + PATH_SEPARATOR)) { exclude = true; } @@ -178,22 +178,22 @@ } private int approximateNumberOfEntries(InstallationType installationType) { - int numberOfEntries = 150; // core (minimum) + int numberOfEntries = 200; // core (minimum) if (installationType.installLibraryModules()) { if (installationType.isStandalone()) { - numberOfEntries += 540; + numberOfEntries += 450; } else { numberOfEntries += 1300; } } if (installationType.installDemosAndExamples()) { - numberOfEntries += 60; + numberOfEntries += 70; } if (installationType.installDocumentation()) { - numberOfEntries += 250; + numberOfEntries += 500; } if (installationType.installSources()) { - numberOfEntries += 800; + numberOfEntries += 1000; } return numberOfEntries; } @@ -269,7 +269,7 @@ exclude = true; Iterator<String> coreLibFilesAsIterator = coreLibFiles.iterator(); while (coreLibFilesAsIterator.hasNext()) { - String coreFileName = (String)coreLibFilesAsIterator.next(); + String coreFileName = coreLibFilesAsIterator.next(); if (zipEntryName.endsWith(PATH_SEPARATOR + coreFileName)) { exclude = false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-10 11:36:11
|
Revision: 7143 http://jython.svn.sourceforge.net/jython/?rev=7143&view=rev Author: otmarhumbel Date: 2010-10-10 11:36:05 +0000 (Sun, 10 Oct 2010) Log Message: ----------- more reliable handling of JAVA_HOME, JYTHON_HOME and JYTHON_OPTS Modified Paths: -------------- trunk/jython/src/shell/jython.bat Modified: trunk/jython/src/shell/jython.bat =================================================================== --- trunk/jython/src/shell/jython.bat 2010-10-10 10:29:15 UTC (rev 7142) +++ trunk/jython/src/shell/jython.bat 2010-10-10 11:36:05 UTC (rev 7143) @@ -25,28 +25,11 @@ rem ----- Verify and set required environment variables ----------------------- set _JAVA_CMD=java -rem remove surrounding quotes from java home, to be able to safely empty-test it -set _TRIMMED_JAVA_HOME=%JAVA_HOME% -for /f "usebackq tokens=*" %%a in ('%_TRIMMED_JAVA_HOME%') do set _TRIMMED_JAVA_HOME=%%~a -if not "%_TRIMMED_JAVA_HOME%"=="" ( - set _JAVA_CMD="%JAVA_HOME:"=%\bin\java" -) +if defined JAVA_HOME set _JAVA_CMD="%JAVA_HOME:"=%\bin\java" +if defined JYTHON_OPTS set _JYTHON_OPTS="%JYTHON_OPTS:"=%" +if defined JYTHON_HOME set _JYTHON_HOME="%JYTHON_HOME:"=%" +if defined _JYTHON_HOME goto gotHome -rem remove surrounding quotes from jython opts, to be able to safely empty-test it -set _TRIMMED_JYTHON_OPTS=%JYTHON_OPTS% -for /f "usebackq tokens=*" %%a in ('%_TRIMMED_JYTHON_OPTS%') do set _TRIMMED_JYTHON_OPTS=%%~a -if not "%_TRIMMED_JYTHON_OPTS%"=="" ( - set _JYTHON_OPTS="%_TRIMMED_JYTHON_OPTS%" -) - -rem remove surrounding quotes from jython home, to be able to safely empty-test it -set _TRIMMED_JYTHON_HOME=%JYTHON_HOME% -for /f "usebackq tokens=*" %%a in ('%_TRIMMED_JYTHON_HOME%') do set _TRIMMED_JYTHON_HOME=%%~a -if not "%_TRIMMED_JYTHON_HOME%"=="" ( - set _JYTHON_HOME="%_TRIMMED_JYTHON_HOME%" - goto gotHome -) - rem try to dynamically determine jython home rem (this script typically resides in jython home, or in the /bin subdirectory) pushd "%~dp0%" @@ -128,10 +111,10 @@ if ["%_CMP%"] == ["--"] goto argsDone if ["%_CMP%"] == ["--jdb"] ( - if "%_TRIMMED_JAVA_HOME%"=="" ( - set _JAVA_CMD=jdb - ) else ( + if defined JAVA_HOME ( set _JAVA_CMD="%JAVA_HOME:"=%\bin\jdb" + ) else ( + set _JAVA_CMD=jdb ) goto :nextArg ) @@ -216,9 +199,6 @@ set _JYTHON_OPTS= set _JYTHON_ARGS= set _PRINT= -set _TRIMMED_JAVA_HOME= -set _TRIMMED_JYTHON_HOME= -set _TRIMMED_JYTHON_OPTS= goto finish This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-10 10:29:22
|
Revision: 7142 http://jython.svn.sourceforge.net/jython/?rev=7142&view=rev Author: otmarhumbel Date: 2010-10-10 10:29:15 +0000 (Sun, 10 Oct 2010) Log Message: ----------- properly quote COMSPEC on exit fixes issue #1661 Modified Paths: -------------- trunk/jython/NEWS trunk/jython/src/shell/jython.bat Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-09 07:53:42 UTC (rev 7141) +++ trunk/jython/NEWS 2010-10-10 10:29:15 UTC (rev 7142) @@ -2,6 +2,7 @@ Jython 2.5.2rc1 Bugs Fixed + - [ 1661 ] Error at on exit in TCC/LE - [ 1639 ] JBoss 5, vfszip protocol in use for jarFileName in PySystemState - [ 1660 ] threading module memory leak - [ 1452 ] pydoc help() function fails because sys.executable is None in stand-alone Jython Modified: trunk/jython/src/shell/jython.bat =================================================================== --- trunk/jython/src/shell/jython.bat 2010-10-09 07:53:42 UTC (rev 7141) +++ trunk/jython/src/shell/jython.bat 2010-10-10 10:29:15 UTC (rev 7142) @@ -295,4 +295,5 @@ :finish -%COMSPEC% /c exit /b %E% +set _UNQUOTED_COMSPEC=%COMSPEC:"=% +"%_UNQUOTED_COMSPEC%" /c exit /b %E% This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-09 07:53:48
|
Revision: 7141 http://jython.svn.sourceforge.net/jython/?rev=7141&view=rev Author: otmarhumbel Date: 2010-10-09 07:53:42 +0000 (Sat, 09 Oct 2010) Log Message: ----------- handle standalone recognition in the JBoss 5 virtual file system fixes issue #1639 many thanks to Eric Lentz! Modified Paths: -------------- trunk/jython/NEWS trunk/jython/src/org/python/core/PySystemState.java Added Paths: ----------- trunk/jython/tests/java/org/python/core/PySystemStateTest.java Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2010-10-07 20:46:21 UTC (rev 7140) +++ trunk/jython/NEWS 2010-10-09 07:53:42 UTC (rev 7141) @@ -2,6 +2,7 @@ Jython 2.5.2rc1 Bugs Fixed + - [ 1639 ] JBoss 5, vfszip protocol in use for jarFileName in PySystemState - [ 1660 ] threading module memory leak - [ 1452 ] pydoc help() function fails because sys.executable is None in stand-alone Jython - [ 1568 ] sys.stdout.encoding returns wrong value in Windows with Jython 2.5.1 (fixed on Java 6 only) Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2010-10-07 20:46:21 UTC (rev 7140) +++ trunk/jython/src/org/python/core/PySystemState.java 2010-10-09 07:53:42 UTC (rev 7141) @@ -16,19 +16,17 @@ import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; import java.security.AccessControlException; -import java.util.concurrent.Callable; -import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import java.util.StringTokenizer; +import java.util.Map.Entry; +import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentMap; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import com.google.common.collect.MapMaker; import org.jruby.ext.posix.util.Platform; import org.python.Version; import org.python.core.adapter.ClassicPyObjectAdapter; @@ -55,6 +53,7 @@ private static final String JAR_URL_PREFIX = "jar:file:"; private static final String JAR_SEPARATOR = "!"; + private static final String VFSZIP_PREFIX = "vfszip:"; public static final PyString version = new PyString(Version.getVersion()); public static final int hexversion = ((Version.PY_MAJOR_VERSION << 24) | @@ -1112,12 +1111,15 @@ * @return the full name of the jar file containing this class, <code>null</code> if not available. */ private static String getJarFileName() { - String jarFileName = null; - Class thisClass = PySystemState.class; + Class<PySystemState> thisClass = PySystemState.class; String fullClassName = thisClass.getName(); String className = fullClassName.substring(fullClassName.lastIndexOf(".") + 1); URL url = thisClass.getResource(className + ".class"); - // we expect an URL like jar:file:/install_dir/jython.jar!/org/python/core/PySystemState.class + return getJarFileNameFromURL(url); + } + + protected static String getJarFileNameFromURL(URL url) { + String jarFileName = null; if (url != null) { try { // escape plus signs, since the URLDecoder would turn them into spaces @@ -1129,7 +1131,21 @@ urlString = urlString.replaceAll(escapedPlus, plus); int jarSeparatorIndex = urlString.lastIndexOf(JAR_SEPARATOR); if (urlString.startsWith(JAR_URL_PREFIX) && jarSeparatorIndex > 0) { + // jar:file:/install_dir/jython.jar!/org/python/core/PySystemState.class jarFileName = urlString.substring(JAR_URL_PREFIX.length(), jarSeparatorIndex); + } else if (urlString.startsWith(VFSZIP_PREFIX)) { + // vfszip:/some/path/jython.jar/org/python/core/PySystemState.class + final String path = PySystemState.class.getName().replace('.', '/'); + int jarIndex = urlString.indexOf(".jar/".concat(path)); + if (jarIndex > 0) { + jarIndex += 4; + int start = VFSZIP_PREFIX.length(); + if (Platform.IS_WINDOWS) { + // vfszip:/C:/some/path/jython.jar/org/python/core/PySystemState.class + start++; + } + jarFileName = urlString.substring(start, jarIndex); + } } } catch (Exception e) {} } Added: trunk/jython/tests/java/org/python/core/PySystemStateTest.java =================================================================== --- trunk/jython/tests/java/org/python/core/PySystemStateTest.java (rev 0) +++ trunk/jython/tests/java/org/python/core/PySystemStateTest.java 2010-10-09 07:53:42 UTC (rev 7141) @@ -0,0 +1,81 @@ +package org.python.core; + +import java.io.IOException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; + +import junit.framework.TestCase; + +import org.jruby.ext.posix.util.Platform; + +public class PySystemStateTest extends TestCase { + + public void testGetJarFileNameFromURL() throws Exception { + // null + assertNull(PySystemState.getJarFileNameFromURL(null)); + // plain jar url + String urlString = "jar:file:/some_dir/some.jar!/a/package/with/A.class"; + URL url = new URL(urlString); + assertEquals("/some_dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + // jar url to decode + urlString = "jar:file:/some%20dir/some.jar!/a/package/with/A.class"; + url = new URL(urlString); + assertEquals("/some dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + // jar url with + signs to escape + urlString = "jar:file:/some+dir/some.jar!/a/package/with/A.class"; + url = new URL(urlString); + assertEquals("/some+dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + } + + public void testGetJarFileNameFromURL_jboss() throws Exception { + final String protocol = "vfszip"; + final String host = ""; + final int port = -1; + final URLStreamHandler handler = new TestJBossURLStreamHandler(); + String file; + URL url; + if (Platform.IS_WINDOWS) { + // plain jboss url + file = "/C:/some_dir/some.jar/org/python/core/PySystemState.class"; + url = new URL(protocol, host, port, file, handler); + // tests with jboss on windows gave URL's like this: + assertEquals("vfszip:/C:/some_dir/some.jar/org/python/core/PySystemState.class", url.toString()); + assertEquals("C:/some_dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + // jboss url to decode + file = "/C:/some%20dir/some.jar/org/python/core/PySystemState.class"; + url = new URL(protocol, host, port, file, handler); + assertEquals("vfszip:/C:/some%20dir/some.jar/org/python/core/PySystemState.class", url.toString()); + assertEquals("C:/some dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + // jboss url with + to escape + file = "/C:/some+dir/some.jar/org/python/core/PySystemState.class"; + url = new URL(protocol, host, port, file, handler); + assertEquals("vfszip:/C:/some+dir/some.jar/org/python/core/PySystemState.class", url.toString()); + assertEquals("C:/some+dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + } else { + // plain jboss url + file = "/some_dir/some.jar/org/python/core/PySystemState.class"; + url = new URL(protocol, host, port, file, handler); + assertEquals("vfszip:/some_dir/some.jar/org/python/core/PySystemState.class", url.toString()); + assertEquals("/some_dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + // jboss url to decode + file = "/some%20dir/some.jar/org/python/core/PySystemState.class"; + url = new URL(protocol, host, port, file, handler); + assertEquals("vfszip:/some%20dir/some.jar/org/python/core/PySystemState.class", url.toString()); + assertEquals("/some dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + // jboss url with + to escape + file = "/some+dir/some.jar/org/python/core/PySystemState.class"; + url = new URL(protocol, host, port, file, handler); + assertEquals("vfszip:/some+dir/some.jar/org/python/core/PySystemState.class", url.toString()); + assertEquals("/some+dir/some.jar", PySystemState.getJarFileNameFromURL(url)); + } + } + + protected static class TestJBossURLStreamHandler extends URLStreamHandler { + + @Override + protected URLConnection openConnection(URL u) throws IOException { + throw new RuntimeException("unexpected call to openConnection " + u.toString()); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2010-10-07 20:46:27
|
Revision: 7140 http://jython.svn.sourceforge.net/jython/?rev=7140&view=rev Author: otmarhumbel Date: 2010-10-07 20:46:21 +0000 (Thu, 07 Oct 2010) Log Message: ----------- Upgraded Guava Google collections to 0.7. Modified Paths: -------------- trunk/jython/.classpath Modified: trunk/jython/.classpath =================================================================== --- trunk/jython/.classpath 2010-10-06 22:44:52 UTC (rev 7139) +++ trunk/jython/.classpath 2010-10-07 20:46:21 UTC (rev 7140) @@ -37,6 +37,6 @@ <classpathentry kind="lib" path="extlibs/jffi-x86_64-SunOS.jar"/> <classpathentry kind="lib" path="extlibs/jffi.jar"/> <classpathentry kind="lib" path="extlibs/jnr-posix.jar"/> - <classpathentry kind="lib" path="extlibs/guava-r05.jar"/> + <classpathentry kind="lib" path="extlibs/guava-r07.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |