Git Product home page Git Product logo

jython's Introduction

Jython: Python for the Java Platform

Maven Central Javadocs

This is the development repository of Jython, the implementation of Python in Java. Only version 2.7 of Python can be supported at present (but watch this space for a 3.x version).

Compatibility

Jython provides good compatibility with Python 2.7 the language. Also, a high proportion of the standard library is included, taken from late versions of CPython (around 2.7.13). Some standard library modules have a Jython-specific implementation that has not kept pace with its CPython counterpart.

Jython 2.7 support for the Python ecosystem includes built-in support of pip/setuptools. You can use bin/pip if the targets do not include C extensions. There is a native launcher for Windows (bin/jython.exe) that works essentially like the python command.

Jim Baker presented a talk at PyCon 2015 about Jython 2.7, including demos of new features: https://www.youtube.com/watch?v=hLm3garVQFo

Support

Python 2.7 (the language) is no longer supported by the PSF. Running on Jython should not be considered an alternative to porting your application to Python 3, due to the limitations cited here and the small amount of effort available to support 2.7.x. Jython 2.7 is offered for continuity because a 3.x is not yet available.

See ACKNOWLEDGMENTS for details about Jython's copyright, license, contributors, and mailing lists. Consult NEWS for detailed release notes, including bugs fixed, backward breaking changes, and new features. We sincerely thank all who contribute to Jython, by bug reports, patches, pull requests, documentation changes and e-mail discussions.

Downloads

Binary downloads are available from https://www.jython.org/download along with Maven and Gradle dependency information.

How to build Jython

The project uses Git for version-control, and the master repository is at https://github.com/jython/jython, You should clone this repository to create a buildable copy of the latest state of the Jython source. Start a new branch for any bug-fix or experimentation you plan.

The previously authoritative repository at https://hg.python.org/jython is not now in use, remaining frozen at v2.7.2.

Build using ant for development

Jython is normally built using ant. It is necessary to have Ant and at least a Java 8 SDK on the path. To build Jython in development, we generally use the command:

ant

This leaves an executable in dist/bin that you may run from the check-out root with:

dist/bin/jython

Other ant targets exist, notably clean, javatest and jar.

You can test your build of Jython (by running the regression tests), with the command:

dist/bin/jython -m test.regrtest -e -m regrtest_memo.txt

or by invoking the Ant target regrtest.

Build an installer using ant

If you want to install a snapshot build of Jython, use the command:

ant installer

This will leave you with a snapshot installer JAR in dist, that you can run with:

java -jar jython-installer.jar

for the graphical installer, or:

java -jar jython-installer.jar --console

For the console version. (A --help option gives you the full story.)

Build a JAR using Gradle

We have a Gradle build that results in a family of JARs and a POM. This is intended to provide the Jython core in a form that Gradle and Maven users can consume as a dependency. Invoke this with:

PS> .\gradlew publish

and a JAR and POM are delivered to .build2\repo

Whereas the JARs delivered by the installer are somewhat "fat", embedding certain dependencies in shaded (renamed) form, the JAR from the Gradle build is "spare" and cites its dependencies externally through a POM.

jython's People

Contributors

adamburkegh avatar agronholm avatar amak avatar bshashank avatar bzimmer avatar cclauss avatar cupdike avatar darjus avatar fwierzbicki avatar groves avatar gvanrossum avatar indrat avatar int3 avatar jamesmudd avatar jeff5 avatar jimbaker avatar juneau001 avatar kzuberi avatar leosoto avatar nriley avatar ohumbel avatar pekkaklarck avatar pjenvey avatar santa4nt avatar stewori avatar tebeka avatar thobe avatar tpoliaw avatar vp-of-awesome avatar warsaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jython's Issues

Using .pem with multiple Public Keys fails

Hi,

We just encountered a problem with this _sslcerts.py while using a .pem file in Datastax OpsCenter 6.0

The .pem file included the public keys for its entire certificate chain. They were in the following order:

  • Private Key
  • Public Key
  • Cert Authority Public Keys

It was picking up the fact that the Cert Authority public keys did not match the private key.

The following loop only seems to determine keys_match based on the last key.

for cert in certs:
            # TODO works for RSA only for now
            if not isinstance(cert.publicKey, RSAPublicKey) and isinstance(private_key, RSAPrivateCrtKey):
                keys_match = True
                continue

            if cert.publicKey.getModulus() == private_key.getModulus() \
                    and cert.publicKey.getPublicExponent() == private_key.getPublicExponent():
                keys_match = True
            else:
                keys_match = False

doing relative imports in a loop causes bad performance due to 2472

the issue https://bugs.jython.org/issue2472 and its subsequent resolution jython/frozen-mirror@bc317e2 causes a side effect where jython will attempt to find a relative import again and again despite having done so in the past.

This violates expected python 2.7 relative import optimisation that places a None whenever an import is not found as opposed to null.

Consider the case of a local import being done on a loop without the use of absolute imports, we will attempt to generate all java classes, org.python.core.JavaImportHelper.tryAddPackage(), org.python.core.JavaImportHelper.buildLoadedPackages(), and java.lang.Package.getPackages() which add up to tons of CPU time usage.

Returned value is set to null when code contains multiple lines using ScriptEngine

Consider the following code :

package org.scijava.jupyterkernel.sandbox;

import javax.script.ScriptEngine;
import javax.script.ScriptException;
import org.scijava.Context;
import org.scijava.script.ScriptLanguage;
import org.scijava.script.ScriptService;

/**
 *
 * @author Hadrien Mary
 */
public class TestScriptEngine {

    public static void main(String[] args) throws ScriptException {
        // Only for testing purpose

        Context context = new Context();
        ScriptService scriptService = context.getService(ScriptService.class);
        ScriptLanguage scriptLanguage = scriptService.getLanguageByName("python");
        ScriptEngine engine = scriptLanguage.getScriptEngine();

        Object result = engine.eval("p=999\n555");
        System.out.println(result);

        scriptService = context.getService(ScriptService.class);
        scriptLanguage = scriptService.getLanguageByName("python");
        engine = scriptLanguage.getScriptEngine();
        
        result = engine.eval("555");
        System.out.println(result);

        context.dispose();
    }

}

It prints:

null
555

While it should prints:

555
555

if a PyException wraps a Java Exception object, then the PyException's getCause() method should return that Java Exception object

If I do this in Jython: (tried with both 2.5.3 and 2.7.0 standalone)

import java.lang.Exception
for k in xrange(10):
   print k
if k > 3: raise java.lang.Exception("Hey")

it works fine; Jython raises a wrapped instance of java.lang.Exception. It appears to be an org.python.core.PyException. Unfortunately this class uses the default constructor of its superclass.

Why does this matter? If the object raised within Jython is a Jython object, rather than a Java exception class, it doesn't matter. But if the object raised within Jython is some Java exception object E, and Jython is embedded within a larger Java program P, then Jython doesn't allow the larger program P to use the standard Throwable.getCause() method to access the Java exception object E: it's been wrapped up opaquely, and unless the program P has special logic that knows about org.python.core.PyException and can somehow access E, it can't benefit from the information contained in E.

I would suggest changing the main constructor of PyException from this

public PyException(PyObject type, PyObject value, PyTraceback traceback) {
        this.type = type;
        this.value = value;
        ...

to this:

public PyException(PyObject type, PyObject value, PyTraceback traceback) {
        super(getJavaExceptionCauseIfPresent(value))
        this.type = type;
        this.value = value;
        ...

where getJavaExceptionCauseIfPresent(value) (or a suitably-named alternative) either returns the wrapped Java object that is inside the PyObject value, if there is one, or null otherwise. This would allow Java programs that embed Jython to access the getCause() method without having to know that the exception thrown by Jython is, in fact, a PyException.

Need to handle these test cases:

    import java.lang.RuntimeException
    def testCase(n, message):
       if n == 0:
         raise java.lang.RuntimeException(message)
       else:
         class MyException(java.lang.RuntimeException):
           pass
         raise MyException(message)

Installing Jython 2.7.1 has issues installing pip on ARM

Installing 2.7.1 on rasbian results in error on setuptools.
I initially installed using sudo java ...
Subsequently changed /usr/share/jython owner and group to current user and ran without sudo:

:/usr/share/jython $ java -jar ../openhab2/jython-installer-2.7.1.jar --console
Welcome to Jython !
You are about to install Jython version 2.7.1
(at any time, answer c to cancel the installation)
For the installation process, the following languages are available: English, German
Please select your language [E/g] >>>
Do you want to read the license agreement now ? [y/N] >>>
Do you accept the license agreement ? [Y/n] >>>
The following installation types are available:
  1. All (everything, including sources)
  2. Standard (core, library modules, demos and examples, documentation)
  3. Minimum (core)
  9. Standalone (a single, executable .jar)
Please select the installation type [ 1 /2/3/9] >>>
Do you want to exclude parts from the installation ? [y/N] >>>
Please enter the target directory >>> /usr/share/jython
Directory /usr/share/jython is not empty - ok to overwrite contents ? [y/N] >>> y
Contents of directory /usr/share/jython will be deleted now! Are you sure to proceed ? [Y/n] >>>
Your java version to start Jython is: Azul Systems, Inc. / 1.8.0_152
Your operating system version is: Linux / 4.14.52-v7+
Summary:
  - mod: true
  - demo: true
  - doc: true
  - src: true
  - ensurepip: true
  - JRE: /usr/lib/jvm/zulu-embedded-8-armhf/jre
Please confirm copying of files to directory /usr/share/jython [Y/n] >>>
 10 %
 20 %
 30 %
 40 %
 50 %
 60 %
 70 %
 80 %
Generating start scripts ...
Installing pip and setuptools
 90 %
Collecting setuptools
Exception:
Traceback (most recent call last):
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 376, in prepare_files
    discovered_reqs.extend(self._prepare_file(
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 376, in prepare_files
    discovered_reqs.extend(self._prepare_file(
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 617, in _prepare_file
    unpack_url(
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 617, in _prepare_file
    unpack_url(
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 715, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 596, in unpack_file
    unzip_file(
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 498, in unzip_file
    ensure_dir(dir)
  File "/tmp/tmpJ9EEoh/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/share/jython/Lib/os.py", line 174, in makedirs
    mkdir(name, mode)
OSError: [Errno 20000] Unknown error: 20000: '/tmp/pip-build-QWhVMF/setuptools'
 100 %

Also

/usr/share/jython $ ./bin/jython  -m ensurepip
Collecting setuptools
Exception:
Traceback (most recent call last):
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 376, in prepare_files
    discovered_reqs.extend(self._prepare_file(
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 376, in prepare_files
    discovered_reqs.extend(self._prepare_file(
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 617, in _prepare_file
    unpack_url(
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 617, in _prepare_file
    unpack_url(
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 715, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 596, in unpack_file
    unzip_file(
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 498, in unzip_file
    ensure_dir(dir)
  File "/tmp/tmponzBlX/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/share/jython/Lib/os.py", line 174, in makedirs
    mkdir(name, mode)
OSError: [Errno 20000] Unknown error: 20000: '/tmp/pip-build-wzPV2x/setuptools'

Maven provides invalid link to License

During the analysis to see if the Jython project is solution for our commercial project, I attempted to identify the license under which the license is released. The Maven repository says that it is the "Jython Software License". As this is not a standard license (i.e.BSD, Apache Public License, GPL etc.) it requires me to review it before I can make a recommendation. Yet the link provided by Maven https://www.jython.org/Project/license.html returns a 404. Either the maven project needs updated to point to correct location, or the license needs uploaded to the correct location at the jython website.

I was able to find the license (Python Software License v2) link from the front page of the website.

Does jython support third-party libraries

In the project, jython-standalone is used to call the python script,
and the third-party library time is called in the script:

Exception in thread "main" Traceback (most recent call last):
  File "D:\project\submit_order.py", line 10, in <module>
    from appium import webdriver
  File "D:\install\python-3.6\Lib\site-packages\appium\webdriver\__init__.py", line 19, in <module>
    from .webdriver import WebDriver as Remote
SyntaxError: ("mismatched input ':' expecting RPAREN", ('D:\\install\\python-3.6\\Lib\\site-packages\\appium\\webdriver\\webdriver.py', 88, 23, 'def _make_w3c_caps(caps: Dict) -> Dict[str, List[Dict[str, Any]]]:\n'))

JNI multiple %TEMP%/jffi???.dll and %TEMP%/jansi???.dll issues.

I've been falling into this mess while working on windows CI regression testing. I finally figured out that jffi leaves a %TEMP%/jffi-????.dll behind. Concurrent processes or new processes after the exit can load this file instead of creating a temp dll which causes a fault that may be related to garbage collection and del until the offending dll is removed. The exceptions start with the following.

 [exec] SEVERE: Failed to submit a listener notification task. Event loop shut down?
 [exec] java.util.concurrent.RejectedExecutionException: event executor terminate

What is odd is that this seems to be a delayed failure somewhere upstream of the test. which succeeds.

This seems to be a jni related issue with multiple related symptoms. A quick search of jffi shows 7 open issue in bugs. 2701 has some references of potential solutions in jruby and other troubleshooting info.

  • 2701 2 months ago JVM seg Faulting when running standalone jython under a child first class loader open Hardy
  • 2651 10 months ago Travis Builds failing with *** buffer overflow detected *** open jamesmudd
  • normal
  • 2121 8 months ago Jython jar on Maven central embeds other third party libraries open tuska
  • 1917 42 months ago No ctypes.c_char open dahlia
  • low
  • 2287 9 months ago multiprocessing module not available open Arfrever
  • 2269 34 months ago jffi*.tmp files left to %TMP% on Windows open pekka.klarck
  • 2270 34 months ago jansi-*.dll left to %TMP% on Windows open pekka.klarck

A specific effected test is test_rpcxml.test_partial_post.

    def test_partial_post(self):
        # Check that a partial POST doesn't make the server loop: issue #14001.
        conn = httplib.HTTPConnection(ADDR, PORT)
        conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
        try:
            conn.close()
        except Exception, e:
            print "Got this exception", type(e), e

A slight modification that still fails is instructive.

    def test_partial_post(self):
        # Check that a partial POST doesn't make the server loop: issue #14001.
        conn = httplib.HTTPConnection(ADDR, PORT)
        conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
        try:
            conn.close()
            print "--------------- No exception in conn.close()"
        except Exception, e:
            print "---------------- Exception in conn.close()"
        print "------------- Leaving test_partial_close"

Now if you run this before deleting the tmp dll, you will get the No exception and leaving message from the routine before the fault prints out midway into the next test.

If you delete the .dll, it will succeed without fault and leave behind a new tmp/dll which will start causing the issue again.

This gets stranger still... If you leave the dll and modify the above routine as follows, it no longer throws an error. Somehow the print statement in the exception clause triggers the issue even though it appears to never execute.

    def test_partial_post(self):
        # Check that a partial POST doesn't make the server loop: issue #14001.
        conn = httplib.HTTPConnection(ADDR, PORT)
        conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
        try:
            conn.close()
            print "--------------- No exception in conn.close()"
        except Exception, e:
            pass
            # print "---------------- Exception in conn.close()"
        print "------------- Leaving test_partial_close"

I've also found that jansi-???.dll in tmp can cause the issue as well.

Two more strange examples seems to be illustrative. What appears to be happening is that JNI is creating a temp.dll to delegate external library actions and embedded in the dll is resources for communicating with the parent thread. When an old dll or one owned by another process is loaded instead of making a new one, the resource sharing or sequencing between the jni thread and the main thread seems to be all horked up. (horked means I'm guessing above my pay grade)

    # THIS VERSION THROWS THE JAVA EXCEPTION
    def test_partial_post(self):
        # Check that a partial POST doesn't make the server loop: issue #14001.
        conn = httplib.HTTPConnection(ADDR, PORT)
        conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
        ee="----- ee initial value"
        try:
            conn.close()
            print "No Exception -------------------------------"
        except Exception, e:
            with open("c:\Users\devendor\weird.log", 'wb') as wl:
                wl.write("what gives?")
                wl.close()
            with open("c:\Users\devendor\weird.log", 'a') as wl:
                wl.write(str(e))
                wl.close()
            with open("c:\Users\devendor\weird.log", 'a') as wl:
                wl.write(ee)
                wl.close()
            try:
                ee="crap"
            except:
                with open("c:\Users\devendor\weird.log", 'a') as wl:
                    wl.write("strange")
                    wl.close()
            finally: ee="crap2"
        print ee

    # THIS DOES NOT THROW THE EXCEPTION
    def test_partial_post(self):
        # Check that a partial POST doesn't make the server loop: issue #14001.
        conn = httplib.HTTPConnection(ADDR, PORT)
        conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
        ee="----- ee initial value"
        try:
            conn.close()
            print "No Exception -------------------------------"
        except Exception, e:
            with open("c:\Users\devendor\weird.log", 'wb') as wl:
                wl.write("what gives?")
                wl.close()
            with open("c:\Users\devendor\weird.log", 'a') as wl:
                wl.write(str(e))
                wl.close()
            with open("c:\Users\devendor\weird.log", 'a') as wl:
                wl.write(ee)
                wl.close()
            try:
                ee="crap"
            except:
                with open("c:\Users\devendor\weird.log", 'a') as wl:
                    wl.write("strange")
                    wl.close()
            #finally: ee="crap2"
        print ee

"""
Both versions print
No Exception ------- 
----- ee initial value
to stdout inline with the test stdout.

Weird log is never created by either. It's probably a failed compile or null reference.  
"""

2651 mentions a buffer overflow, so it's likely pointing at some memory address only valid in the process that created the dll and the trigger probably requires some code that can't be optimized away from the need to communicate with the parent/caller.

Cannot be run as a jar-in-jar resource

I'm trying to run jython as a jar-in-jar resource for my specific usecase (minecraft mod), but dependencies are jar-in-jar and it causes this error:

[18:23:56] [Thread-52/INFO]: [STDERR]: java.lang.IllegalArgumentException: URI scheme is not "file"
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at java.io.File.<init>(Unknown Source)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PrePy.getJarFileNameFromURL(PrePy.java:427)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PrePy._getJarFileName(PrePy.java:362)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PrePy.getJarFileName(PrePy.java:345)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PySystemState.doInitialize(PySystemState.java:1195)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PySystemState.initialize(PySystemState.java:1130)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PySystemState.initialize(PySystemState.java:1085)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PySystemState.initialize(PySystemState.java:1080)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PySystemState.initialize(PySystemState.java:1075)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.PySystemState.initialize(PySystemState.java:1070)
[18:23:56] [Thread-52/INFO]: [STDERR]: 	at org.python.core.ThreadStateMapping.getThreadState(ThreadStateMapping.java:56)

I can manually pull the dependency out to make it not jar-in-jar and it works, but that's not user-friendly.

non-ASCII exception

Hi, I found a small bug in Jython (2.7.2). Jython is throwing a unicode exception when it tries to load some files from the path which contains non-ASCII characters (for example non-ASCII character could be in username in Windows - C:\Users\Micha?\AppData\Roaming\BurpSuite\bapps\a158fd3fc9394253be3aa0bc4c181d1f)

Full stacktrace is below:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: (22, 'Invalid argument', 'C:\\Users\\Micha?\\AppData\\Roaming\\BurpSuite\\bapps\\a158fd3fc9394253be3aa0bc4c181d1f')

	at org.python.core.Py.OSError(Py.java:135)
	at org.python.modules.posix.PosixModule.absolutePath(PosixModule.java:1343)
	at org.python.modules.posix.PosixModule.chdir(PosixModule.java:300)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:208)
	at org.python.core.PyObject.__call__(PyObject.java:461)
	at org.python.core.PyObject.__call__(PyObject.java:465)
	at org.python.pycode._pyx2.f$0(<string>:1)
	at org.python.pycode._pyx2.call_function(<string>)
	at org.python.core.PyTableCode.call(PyTableCode.java:173)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1687)
	at org.python.core.Py.exec(Py.java:1731)
	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:268)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at burp.gbi.<init>(Unknown Source)
	at burp.gvv.a(Unknown Source)
	at burp.elq.lambda$panelLoaded$0(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)

-Q new always fails

When running jython with -Qnew, it always errors out.

Looks like there should be a break after new in the switch case to prevent the -Q option from falling through to the default failure

Issue about type casting

I'm using jython 2.7.2 in my Java application and have an issue about type casting.

Python code.

import java

s = java.lang.String()
print type(s)
print type(java.lang.String())

def f():
    s2 = java.lang.String()
    print type(s2)
f()
ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("python");
PythonInterpreter interpreter = new PythonInterpreter();
StringBuilder sb = new StringBuilder(200);
sb.append("import java\n");
sb.append("s = java.lang.String()\n");
sb.append("print type(s)\n");
sb.append("print type(java.lang.String())\n");
sb.append("def f():\n");
sb.append("    s2 = java.lang.String()\n");
sb.append("    print type(s2)\n");
sb.append("f()\n");

scriptEngine.eval(sb.toString());
System.out.println("=====================");
interpreter.exec(sb.toString());

The output

<type 'unicode'>
<type 'java.lang.String'>
<type 'java.lang.String'>
=====================
<type 'java.lang.String'>
<type 'java.lang.String'>
<type 'java.lang.String'>

Why the first type is unicode?

Support module _winreg

Hi, while I'm trying to install and use Z3 within software reverse engineering framework via Jython, I see that Jython doesn't support the module _winreg yet.

image

Command for testing:
java -jar jython-standalone-2.7.2.jar -c "import _winreg"

Unable to access method of inner static class

Hi, I'm using Jython 2.7.2. But I can't access method of inner static class.

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class TestInnerClass {

    Inner inner;

    public static void main(String[] args) throws Exception {
        ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("python");

        TestInnerClass test = new TestInnerClass();
        test.inner = new Inner("hello");

        System.out.println(test.inner.getName());

        scriptEngine.put("test", test);

        // toString works.
        scriptEngine.eval("print test.inner.toString()");

        // object has no attribute 'getName' exception
        scriptEngine.eval("print test.inner.getName()");
    }

    public Inner getInner() {
        return inner;
    }

    static class Inner {
        String name;

        public Inner(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        @Override
        public String toString() {
            return name;
        }
    }
}

PyString with non-byte value while installing pip

  1. OS: Win 10
  2. Jython version: 2.7.1
  3. Java version: 1.8
  4. Run jython -m ensurepip
C:\Users\Memory>jython --version
Jython 2.7.1

C:\Users\Memory>java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

C:\Users\Memory>jython -m ensurepip
�[31mException:
Traceback (most recent call last):
  File "C:\Users\Memory\AppData\Local\Temp\tmplfy1lv\pip-9.0.1-py2.py3-none-any.whl\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Memory\AppData\Local\Temp\tmplfy1lv\pip-9.0.1-py2.py3-none-any.whl\pip\commands\install.py", line 270, in run
    global_options = options.global_options or []
  File "C:\Users\Memory\AppData\Local\Temp\tmplfy1lv\pip-9.0.1-py2.py3-none-any.whl\pip\basecommand.py", line 71, in _build_session
    retries=retries if retries is not None else options.retries,
  File "C:\Users\Memory\AppData\Local\Temp\tmplfy1lv\pip-9.0.1-py2.py3-none-any.whl\pip\download.py", line 329, in __init__
    self.headers["User-Agent"] = user_agent()
  File "C:\Users\Memory\AppData\Local\Temp\tmplfy1lv\pip-9.0.1-py2.py3-none-any.whl\pip\download.py", line 110, in user_agent
    if platform.system():
  File "C:\opt\jython2.7.1\Lib\platform.py", line 1396, in system
    return uname()[0]
  File "C:\opt\jython2.7.1\Lib\platform.py", line 1213, in uname
    machine = os.uname()[4]
IllegalArgumentException: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value�[0m

Support CFUNCTYPE attribute for module ctypes

Hi, while I'm trying to install and use Z3 within software reverse engineering framework via Jython, I see that Jython doesn't support the CFUNCTYPE attribute for the module ctypes yet.

image

Command for testing:
java -jar jython-standalone-2.7.2.jar -c "import ctypes;_error_handler_type = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_uint)"

Python 3 support enabling Django

Django on Jython

Jython is an implementation of Python that runs on the Java platform (JVM).

If you want to use Jython (which supports only Python 2.7 at the time of this writing), you must use Django 1.11.x (the last series to support Python 2). Jython support may be readded to Django if a Python 3 compatible Jython is released.

AbstractClass StackOverflow with python.security.respectJavaAccessibility=false

Accidentally ran tests with python.security.respectJavaAccessibility disabled and found a recursion StackOverFlowError.

JYTHON_OPTS=-Dpython.security.respectJavaAccessibility=false

bash$ echo -e "from java.util import AbstractList as A\nclass E(A): pass\nE().get(42)" | \
        /usr/bin/env JYTHON_OPTS=-Dpython.security.respectJavaAccessibility=false jython

Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)

SSLError(1, u'Received fatal alert: internal_error') while requesting ssl pages

Hi there,

i am very new to jython and found an issue. My environemt in an raspberry pi 3 with DietPi v6.26.3. The java environment is aopenHAB instalaltion that uses

openjdk version "1.8.0_222" OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178) OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)

If i try to request a ssl webpage with the requests library i got the following error:

Traceback (most recent call last): File "/etc/openhab2/automation/lib/python/core/log.py", line 51, in wrapper return fn(*args, **kwargs) File "<script>", line 19, in ReadIceWarning File "/etc/openhab2/automation/lib/python/requests/api.py", line 116, in post return request('post', url, data=data, json=json, **kwargs) File "/etc/openhab2/automation/lib/python/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/etc/openhab2/automation/lib/python/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/etc/openhab2/automation/lib/python/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/etc/openhab2/automation/lib/python/requests/adapters.py", line 514, in send raise SSLError(e, request=request) SSLError: HTTPSConnectionPool(host='api.eiswarnung.de', port=443): Max retries exceeded with url: /api/public/?lng=9.66561413531053&key=xxxxxxxxxxxxxx&lat=53.73338496170717 (Caused by SSLError(SSLError(1, u'Received fatal alert: internal_error'),))

Unfortunately if i use the same request statements in pure python the request ist working well.

Maybe someone has a hint on that.

How to build jythonc from source

I want to use jythonc generate java class file from python script independently. Is there any documentation on how to build jythonc from source? Thanks a lot!

Transfer open issues and PRs from frozen-mirror

Until recently, issues and PRs were accepted on https://github.com/jythontools/jython (now https://github.com/jython/frozen-mirror).

A good few are still open there and should really be in this repo now. It's a manual process of a few clicks. We'll close instead if we can do so politely.

Transferring will give them a new number, but experiments have shown that a transferred issue, referred to by its old URL, redirects to the new location, even when the repo has also moved.

Java 13 module

Hi, im trying to use jython 2.7.2 with openjdk-13, but the jar file contains 3 module-info of
org.objectweb.asm.util, interfering with the "requires jython" in my module-info.

I suppose jython is not modularized, so will be nice a version without those files, to avoid import conflicts.

java.lang.IllegalArgumentException: URI is not hierarchical when run as a jar-in-jar resource

log:

java.lang.IllegalArgumentException: URI is not hierarchical
	at java.io.File.<init>(Unknown Source) ~[na:1.8.0_202]
	at org.python.core.PrePy.getJarFileNameFromURL(PrePy.java:427) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.core.PrePy._getJarFileName(PrePy.java:362) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.core.PrePy.getJarFileName(PrePy.java:345) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.core.PySystemState.doInitialize(PySystemState.java:1195) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.core.PySystemState.initialize(PySystemState.java:1130) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.core.PySystemState.initialize(PySystemState.java:1085) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.core.PySystemState.initialize(PySystemState.java:1080) ~[jython-2.7.2.jar!/:2.7.2]
	at org.python.util.PythonInterpreter.initialize(PythonInterpreter.java:63) ~[jython-2.7.2.jar!/:2.7.2]

code:

        Properties props = new Properties();
        props.put("python.security.respectJavaAccessibility", "false"); 
        props.put("python.import.site","false");
        Properties preprops = System.getProperties();
        PythonInterpreter.initialize(preprops, props, new String[0]);
        PythonInterpreter interpreter = new PythonInterpreter();  //Here is the trigger point
        interpreter.exec("import math");
        interpreter.exec("import sys");
``
It works in IDE,But when I package it into a jar file and use it like this, I get an error: java -jar XXXX.jar.
I hope to get help, how do I use it

How to load python code under a module name space?

I have Python code of a module in a string, not in a file, and I cannot loadthis code as a module with its own namespace which can be reference later on.

Here the example: The Python code is stored in the Java string consts_str which contains

MAGIC_NUMBER = 12456789
MAGIC_STRING = "GREAT!"

and I want to load this as the Python module consts.

In Java I tried to load it like this:

PythonInterpreter pi= new PythonInterpreter();
PyCode pc = pi.compile(consts_str, "consts.py");
pi.exec(pc)

However, this loads the constants MAGIC_NUMBER and MAGIC_STRING in the main namespace. How can I load/execute the python code string so that its content is loaded in its own module and that subsequent Python code I feed the interperter pi can reference it as

from consts import MAGIC_NUMBER 

Please note the const declarations for MAGIC_NUMBER/MAGIC_STRING are not available as files, only as strings!

Migration from Mercurial has corrupted project history

The repository, migrated from Mercurial at the start of June 2020, has suffered some corruption in the process, which we have only just noticed.

Here and there, the translation process has lost the link from the first change set on a "topic branch",
back to its parent node. The effect is to make it look like the entire content of the repository is new at that change set. If you scroll back in the history of almost any file it stops (or rather begins) at the latest of these false roots.

The migration was carried out as an import using GitHub Importer, which produced no message that it was failing. (There were messages about linking contributor identities, which we addressed in #1.) We're sorry not to have noticed this sooner. A fix is in progress that involves a fresh start, then the rebasing of changes made migration. This will invalidate forks you may have made.

We will try to fix as much of this as we can from our side, but that won't be free of downstream annoyances. The project has asked GitHub support how we can minimise these annoyances.

Wrote table title with unicode strings and got some string content is unreadable

I wrote a excel file by openpyxl with Jython 2.7.1 final, when i opened the file, i got the "Could not open xxx.xlsx because some content is unreadable....." message, look at the following picture.
popup warning information
Then i clicked "Open and Repair" button to open the problematic excel file. i found the problem came from the table title, all the unicode(Chinese) string display normally, but it's existing problem in fact, look at the following picture.
incorrect unicode string

But the same code is working fine under Python 2.7.5

works fine under Python 2.7.5

To reproduce this issue, you should do pip install openpyxl , and then run the following Python/Jython script file.
write_unicode_table_title.py

# -*- coding:utf-8 -*-
import sys, string
import openpyxl
from openpyxl import styles
from openpyxl.worksheet import table

reload(sys)
sys.setdefaultencoding('utf-8')

wb = openpyxl.Workbook()
ws = wb.active
ws.title = "demo"
table_start_row = 7
wlserver_config_mbeans = 4 # based on original code
table_end_row = table_start_row + wlserver_config_mbeans

table_style = table.TableStyleInfo(name="TableStyleMedium9", showRowStripes=True)
table = table.Table(displayName=u'WLServer列表', ref="A{0}:F{1}".format(table_start_row, table_end_row), tableStyleInfo=table_style)

servers_table_title = [u'序号', u'Server名称', u'Server监听地址', u'Server监听端口', u'Server启动状态', u'Server健康状态']

for index, item in enumerate(servers_table_title):
    ws[string.ascii_uppercase[index] + str(table_start_row)] = item
    ws[string.ascii_uppercase[index] + str(table_start_row)].font = styles.Font(name='Microsoft YaHei', color=styles.colors.WHITE, bold=False)
ws.add_table(table)
wb.save('bug899_1.xlsx')

Cannot embed jython-standalone in an OSGI bundle

Using Maven Felix Bundle plugin 3.3.0, I get the following error when I try to package jython-standalone in the same JAR with my OSGI bundle (using latest 2.7.1-rc3):

[ERROR] Bundle (my_groupid):(my_artifactid):bundle:(my_version) : Classes found in the wrong directory: {Lib/encodings/mac_centeuro$py.class=encodings.mac_centeuro$py, Lib/ensurepip/init$py.class=ensurepip$py, Lib/encodings/utf_16$py.class=encodings.utf_16$py, Lib/json/tests/test_separators$py.class=json.tests.test_separators$py, Lib/pyclbr$py.class=pyclbr$py, Lib/ihooks$py.class=ihooks$py, Lib/mimetools$py.class=mimetools$py, Lib/dircache$py.class=dircache$py, Lib/_strptime$py.class=_strptime$py, Lib/modjy/modjy_publish$py.class=modjy.modjy_publish$py, Lib/encodings/iso2022_jp_2$py.class=encodings.iso2022_jp_2$py, Lib/codeop$py.class=codeop$py, Lib/encodings/utf_7$py.class=encodings.utf_7$py, Lib/lib2to3/fixes/fix_dict$py.class=lib2to3.fixes.fix_dict$py, Lib/distutils/tests/test_util$py.class=distutils.tests.test_util$py, Lib/sched$py.class=sched$py, Lib/abc$py.class=abc$py, Lib/email/init$py.class=email$py, Lib/encodings/zlib_codec$py.class=encodings.zlib_codec$py, Lib/distutils/init$py.class=distutils$py, Lib/optparse$py.class=optparse$py, Lib/stat$py.class=stat$py, Lib/email/message$py.class=email.message$py, Lib/distutils/tests/test_bdist_dumb$py.class=distutils.tests.test_bdist_dumb$py, Lib/hashlib$py.class=hashlib$py, Lib/lib2to3/fixes/fix_map$py.class=lib2to3.fixes.fix_map$py, Lib/json/tests/init$py.class=json.tests$py, Lib/linecache$py.class=linecache$py, Lib/distutils/filelist$py.class=distutils.filelist$py, Lib/collections$py.class=collections$py, Lib/json/tests/test_recursion$py.class=json.tests.test_recursion$py, Lib/lib2to3/fixes/fix_numliterals$py.class=lib2to3.fixes.fix_numliterals$py, Lib/xml/dom/expatbuilder$py.class=xml.dom.expatbuilder$py, Lib/encodings/iso8859_4$py.class=encodings.iso8859_4$py, Lib/lib2to3/fixes/fix_itertools_imports$py.class=lib2to3.fixes.fix_itertools_imports$py, Lib/email/mime/init$py.class=email.mime$py, Lib/xml/sax/handler$py.class=xml.sax.handler$py, Lib/distutils/archive_util$py.class=distutils.archive_util$py, Lib/email/quoprimime$py.class=email.quoprimime$py, Lib/encodings/idna$py.class=encodings.idna$py, Lib/pdb$py.class=pdb$py, Lib/email/mime/image$py.class=email.mime.image$py, Lib/encodings/cp037$py.class=encodings.cp037$py, Lib/encodings/aliases$py.class=encodings.aliases$py, Lib/lib2to3/fixes/fix_callable$py.class=lib2to3.fixes.fix_callable$py, Lib/encodings/cp720$py.class=encodings.cp720$py, Lib/encodings/cp737$py.class=encodings.cp737$py, Lib/tty$py.class=tty$py, Lib/wsgiref/validate$py.class=wsgiref.validate$py, Lib/ensurepip/_uninstall$py.class=ensurepip._uninstall$py, Lib/readline$py.class=readline$py, Lib/macpath$py.class=macpath$py, Lib/lib2to3/fixes/fix_nonzero$py.class=lib2to3.fixes.fix_nonzero$py, Lib/cgitb$py.class=cgitb$py, Lib/unittest/signals$py.class=unittest.signals$py, Lib/zipfile$py.class=zipfile$py, Lib/lib2to3/fixes/fix_long$py.class=lib2to3.fixes.fix_long$py, Lib/email/parser$py.class=email.parser$py, Lib/email/utils$py.class=email.utils$py, Lib/_fix_jython_setuptools_osx$py.class=_fix_jython_setuptools_osx$py, Lib/new$py.class=new$py, Lib/dummy_threading$py.class=dummy_threading$py, Lib/sha$py.class=sha$py, Lib/_io$py.class=_io$py, Lib/distutils/command/upload$py.class=distutils.command.upload$py, Lib/user$py.class=user$py, Lib/distutils/tests/test_install_lib$py.class=distutils.tests.test_install_lib$py, Lib/lib2to3/pgen2/pgen$py.class=lib2to3.pgen2.pgen$py, Lib/modjy/modjy_response$py.class=modjy.modjy_response$py, Lib/encodings/euc_jisx0213$py.class=encodings.euc_jisx0213$py, Lib/lib2to3/fixes/fix_tuple_params$py.class=lib2to3.fixes.fix_tuple_params$py, Lib/modjy/modjy_write$py.class=modjy.modjy_write$py, Lib/codecs$py.class=codecs$py, Lib/distutils/sysconfig$py.class=distutils.sysconfig$py, Lib/distutils/tests/test_install$py.class=distutils.tests.test_install$py, Lib/distutils/file_util$py.class=distutils.file_util$py, Lib/pawt/swing$py.class=pawt.swing$py, Lib/xml/Uri$py.class=xml.Uri$py, Lib/distutils/tests/test_dep_util$py.class=distutils.tests.test_dep_util$py, Lib/email/mime/nonmultipart$py.class=email.mime.nonmultipart$py, Lib/distutils/tests/test_msvc9compiler$py.class=distutils.tests.test_msvc9compiler$py, Lib/unittest/test/test_assertions$py.class=unittest.test.test_assertions$py, Lib/distutils/command/install_egg_info$py.class=distutils.command.install_egg_info$py, Lib/telnetlib$py.class=telnetlib$py, Lib/encodings/iso2022_jp$py.class=encodings.iso2022_jp$py, Lib/distutils/extension$py.class=distutils.extension$py, Lib/encodings/palmos$py.class=encodings.palmos$py, Lib/filecmp$py.class=filecmp$py, Lib/encodings/euc_jp$py.class=encodings.euc_jp$py, Lib/rfc822$py.class=rfc822$py, Lib/distutils/text_file$py.class=distutils.text_file$py, Lib/encodings/ptcp154$py.class=encodings.ptcp154$py, Lib/lib2to3/fixes/fix_reduce$py.class=lib2to3.fixes.fix_reduce$py, Lib/distutils/dist$py.class=distutils.dist$py, Lib/SocketServer$py.class=SocketServer$py, Lib/gettext$py.class=gettext$py, Lib/_sslcerts$py.class=_sslcerts$py, Lib/encodings/iso8859_14$py.class=encodings.iso8859_14$py, Lib/platform$py.class=platform$py, Lib/site$py.class=site$py, Lib/encodings/cp855$py.class=encodings.cp855$py, Lib/lib2to3/fixes/init$py.class=lib2to3.fixes$py, Lib/modjy/modjy_exceptions$py.class=modjy.modjy_exceptions$py, Lib/mailbox$py.class=mailbox$py, Lib/distutils/tests/test_archive_util$py.class=distutils.tests.test_archive_util$py, Lib/email/test/test_email_torture$py.class=email.test.test_email_torture$py, Lib/_fsum$py.class=_fsum$py, Lib/distutils/command/check$py.class=distutils.command.check$py, Lib/popen2$py.class=popen2$py, Lib/dis$py.class=dis$py, Lib/jythonlib$py.class=jythonlib$py, Lib/tempfile$py.class=tempfile$py, Lib/lib2to3/fixes/fix_exitfunc$py.class=lib2to3.fixes.fix_exitfunc$py, Lib/lib2to3/pgen2/init$py.class=lib2to3.pgen2$py, Lib/encodings/cp1254$py.class=encodings.cp1254$py, Lib/symbol$py.class=symbol$py, Lib/lib2to3/fixes/fix_next$py.class=lib2to3.fixes.fix_next$py, Lib/rlcompleter$py.class=rlcompleter$py, Lib/lib2to3/fixes/fix_methodattrs$py.class=lib2to3.fixes.fix_methodattrs$py, Lib/lib2to3/fixes/fix_except$py.class=lib2to3.fixes.fix_except$py, Lib/UserDict$py.class=UserDict$py, Lib/textwrap$py.class=textwrap$py, Lib/encodings/iso8859_3$py.class=encodings.iso8859_3$py, Lib/compiler/pyassem$py.class=compiler.pyassem$py, Lib/lib2to3/pgen2/tokenize$py.class=lib2to3.pgen2.tokenize$py, Lib/unittest/test/test_runner$py.class=unittest.test.test_runner$py, Lib/encodings/cp856$py.class=encodings.cp856$py, Lib/encodings/iso2022_jp_2004$py.class=encodings.iso2022_jp_2004$py, Lib/lib2to3/pgen2/conv$py.class=lib2to3.pgen2.conv$py, Lib/encodings/mac_croatian$py.class=encodings.mac_croatian$py, Lib/distutils/tests/test_install_data$py.class=distutils.tests.test_install_data$py, Lib/json/tests/test_pass1$py.class=json.tests.test_pass1$py, Lib/distutils/dep_util$py.class=distutils.dep_util$py, Lib/encodings/unicode_escape$py.class=encodings.unicode_escape$py, Lib/opcode$py.class=opcode$py, Lib/lib2to3/fixes/fix_throw$py.class=lib2to3.fixes.fix_throw$py, Lib/pydoc_data/topics$py.class=pydoc_data.topics$py, Lib/CGIHTTPServer$py.class=CGIHTTPServer$py, Lib/lib2to3/fixes/fix_repr$py.class=lib2to3.fixes.fix_repr$py, Lib/email/_parseaddr$py.class=email._parseaddr$py, Lib/chunk$py.class=chunk$py, Lib/_abcoll$py.class=_abcoll$py, Lib/distutils/command/bdist$py.class=distutils.command.bdist$py, Lib/xml/dom/xmlbuilder$py.class=xml.dom.xmlbuilder$py, Lib/tabnanny$py.class=tabnanny$py, Lib/future_builtins$py.class=future_builtins$py, Lib/lib2to3/fixes/fix_xreadlines$py.class=lib2to3.fixes.fix_xreadlines$py, Lib/compiler/visitor$py.class=compiler.visitor$py, Lib/fractions$py.class=fractions$py, Lib/warnings$py.class=warnings$py, Lib/distutils/tests/test_filelist$py.class=distutils.tests.test_filelist$py, Lib/smtplib$py.class=smtplib$py, Lib/unittest/util$py.class=unittest.util$py, Lib/lib2to3/pgen2/token$py.class=lib2to3.pgen2.token$py, Lib/encodings/utf_32$py.class=encodings.utf_32$py, Lib/encodings/utf_32_be$py.class=encodings.utf_32_be$py, Lib/lib2to3/fixes/fix_operator$py.class=lib2to3.fixes.fix_operator$py, Lib/genericpath$py.class=genericpath$py, Lib/sre_parse$py.class=sre_parse$py, Lib/plistlib$py.class=plistlib$py, Lib/unicodedata$py.class=unicodedata$py, Lib/copy$py.class=copy$py, Lib/distutils/command/install_headers$py.class=distutils.command.install_headers$py, Lib/encodings/iso2022_kr$py.class=encodings.iso2022_kr$py, Lib/pawt/init$py.class=pawt$py, Lib/unittest/case$py.class=unittest.case$py, Lib/traceback$py.class=traceback$py, Lib/xml/dom/minidom$py.class=xml.dom.minidom$py, Lib/distutils/command/config$py.class=distutils.command.config$py, Lib/cmd$py.class=cmd$py, Lib/distutils/tests/test_check$py.class=distutils.tests.test_check$py, Lib/xml/sax/_exceptions$py.class=xml.sax._exceptions$py, Lib/encodings/cp1258$py.class=encodings.cp1258$py, Lib/encodings/utf_8_sig$py.class=encodings.utf_8_sig$py, Lib/SimpleHTTPServer$py.class=SimpleHTTPServer$py, Lib/xml/dom/minicompat$py.class=xml.dom.minicompat$py, Lib/Cookie$py.class=Cookie$py, Lib/encodings/cp950$py.class=encodings.cp950$py, Lib/encodings/cp500$py.class=encodings.cp500$py, Lib/encodings/mac_greek$py.class=encodings.mac_greek$py, Lib/xml/etree/ElementPath$py.class=xml.etree.ElementPath$py, Lib/anydbm$py.class=anydbm$py, Lib/unittest/test/test_setups$py.class=unittest.test.test_setups$py, Lib/encodings/punycode$py.class=encodings.punycode$py, Lib/json/tests/test_tool$py.class=json.tests.test_tool$py, Lib/encodings/utf_32_le$py.class=encodings.utf_32_le$py, Lib/formatter$py.class=formatter$py, Lib/encodings/_java$py.class=encodings._java$py, Lib/lib2to3/fixes/fix_urllib$py.class=lib2to3.fixes.fix_urllib$py, Lib/sndhdr$py.class=sndhdr$py, Lib/xml/sax/drivers2/drv_javasax$py.class=xml.sax.drivers2.drv_javasax$py, Lib/lib2to3/fixes/fix_itertools$py.class=lib2to3.fixes.fix_itertools$py, Lib/email/feedparser$py.class=email.feedparser$py, Lib/encodings/iso8859_5$py.class=encodings.iso8859_5$py, Lib/asynchat$py.class=asynchat$py, Lib/compiler/syntax$py.class=compiler.syntax$py, Lib/json/tests/test_check_circular$py.class=json.tests.test_check_circular$py, Lib/encodings/cp862$py.class=encodings.cp862$py, Lib/modjy/modjy_params$py.class=modjy.modjy_params$py, Lib/ftplib$py.class=ftplib$py, Lib/sre_constants$py.class=sre_constants$py, Lib/markupbase$py.class=markupbase$py, Lib/xml/sax/saxlib$py.class=xml.sax.saxlib$py, Lib/modjy/init$py.class=modjy$py, Lib/robotparser$py.class=robotparser$py, Lib/encodings/tis_620$py.class=encodings.tis_620$py, Lib/encodings/cp1250$py.class=encodings.cp1250$py, Lib/datetime$py.class=datetime$py, Lib/multifile$py.class=multifile$py, Lib/xml/FtCore$py.class=xml.FtCore$py, Lib/commands$py.class=commands$py, Lib/repr$py.class=repr$py, Lib/distutils/util$py.class=distutils.util$py, Lib/compiler/ast$py.class=compiler.ast$py, Lib/wsgiref/headers$py.class=wsgiref.headers$py, Lib/email/encoders$py.class=email.encoders$py, Lib/encodings/cp437$py.class=encodings.cp437$py, Lib/encodings/bz2_codec$py.class=encodings.bz2_codec$py, Lib/encodings/uu_codec$py.class=encodings.uu_codec$py, Lib/os$py.class=os$py, Lib/encodings/cp875$py.class=encodings.cp875$py, Lib/distutils/cmd$py.class=distutils.cmd$py, Lib/distutils/command/clean$py.class=distutils.command.clean$py, Lib/encodings/iso8859_10$py.class=encodings.iso8859_10$py, Lib/email/mime/application$py.class=email.mime.application$py, Lib/lib2to3/fixes/fix_print$py.class=lib2to3.fixes.fix_print$py, Lib/encodings/mbcs$py.class=encodings.mbcs$py, Lib/xml/sax/drivers2/init$py.class=xml.sax.drivers2$py, Lib/lib2to3/fixer_base$py.class=lib2to3.fixer_base$py, Lib/unittest/test/test_discovery$py.class=unittest.test.test_discovery$py, Lib/distutils/versionpredicate$py.class=distutils.versionpredicate$py, Lib/xml/sax/init$py.class=xml.sax$py, Lib/encodings/rot_13$py.class=encodings.rot_13$py, Lib/py_compile$py.class=py_compile$py, Lib/unittest/test/test_suite$py.class=unittest.test.test_suite$py, Lib/unittest/init$py.class=unittest$py, Lib/functools$py.class=functools$py, Lib/ConfigParser$py.class=ConfigParser$py, Lib/encodings/utf_16_le$py.class=encodings.utf_16_le$py, Lib/modjy/modjy_log$py.class=modjy.modjy_log$py, Lib/encodings/cp864$py.class=encodings.cp864$py, Lib/netrc$py.class=netrc$py, Lib/_MozillaCookieJar$py.class=_MozillaCookieJar$py, Lib/lib2to3/fixes/fix_apply$py.class=lib2to3.fixes.fix_apply$py, Lib/email/base64mime$py.class=email.base64mime$py, Lib/posixfile$py.class=posixfile$py, Lib/encodings/iso8859_2$py.class=encodings.iso8859_2$py, Lib/distutils/tests/test_clean$py.class=distutils.tests.test_clean$py, Lib/encodings/iso8859_8$py.class=encodings.iso8859_8$py, Lib/threading$py.class=threading$py, Lib/encodings/cp1006$py.class=encodings.cp1006$py, Lib/distutils/tests/test_build$py.class=distutils.tests.test_build$py, Lib/smtpd$py.class=smtpd$py, Lib/mailcap$py.class=mailcap$py, Lib/xml/dom/NodeFilter$py.class=xml.dom.NodeFilter$py, Lib/lib2to3/fixes/fix_idioms$py.class=lib2to3.fixes.fix_idioms$py, Lib/unittest/runner$py.class=unittest.runner$py, Lib/distutils/core$py.class=distutils.core$py, Lib/lib2to3/fixes/fix_xrange$py.class=lib2to3.fixes.fix_xrange$py, Lib/_rawffi$py.class=_rawffi$py, Lib/unittest/test/test_break$py.class=unittest.test.test_break$py, Lib/modjy/modjy$py.class=modjy.modjy$py, Lib/_LWPCookieJar$py.class=_LWPCookieJar$py, Lib/json/tool$py.class=json.tool$py, Lib/distutils/command/bdist_rpm$py.class=distutils.command.bdist_rpm$py, Lib/encodings/shift_jis_2004$py.class=encodings.shift_jis_2004$py, Lib/nturl2path$py.class=nturl2path$py, Lib/encodings/cp949$py.class=encodings.cp949$py, Lib/pydoc$py.class=pydoc$py, Lib/HTMLParser$py.class=HTMLParser$py, Lib/distutils/msvccompiler$py.class=distutils.msvccompiler$py, Lib/distutils/command/bdist_msi$py.class=distutils.command.bdist_msi$py, Lib/lib2to3/pytree$py.class=lib2to3.pytree$py, Lib/compileall$py.class=compileall$py, Lib/sre_compile$py.class=sre_compile$py, Lib/email/mime/message$py.class=email.mime.message$py, Lib/lib2to3/fixes/fix_unicode$py.class=lib2to3.fixes.fix_unicode$py, Lib/socket$py.class=socket$py, Lib/distutils/command/build_clib$py.class=distutils.command.build_clib$py, Lib/email/test/test_email_codecs_renamed$py.class=email.test.test_email_codecs_renamed$py, Lib/encodings/mac_romanian$py.class=encodings.mac_romanian$py, Lib/lib2to3/fixes/fix_input$py.class=lib2to3.fixes.fix_input$py, Lib/encodings/init$py.class=encodings$py, Lib/io$py.class=io$py, Lib/shelve$py.class=shelve$py, Lib/json/tests/test_indent$py.class=json.tests.test_indent$py, Lib/cgi$py.class=cgi$py, Lib/distutils/tests/test_spawn$py.class=distutils.tests.test_spawn$py, Lib/xml/dom/domreg$py.class=xml.dom.domreg$py, Lib/encodings/cp1256$py.class=encodings.cp1256$py, Lib/encodings/cp857$py.class=encodings.cp857$py, Lib/logging/config$py.class=logging.config$py, Lib/json/tests/test_pass2$py.class=json.tests.test_pass2$py, Lib/encodings/hz$py.class=encodings.hz$py, Lib/compiler/future$py.class=compiler.future$py, Lib/distutils/tests/test_bdist_rpm$py.class=distutils.tests.test_bdist_rpm$py, Lib/encodings/iso8859_13$py.class=encodings.iso8859_13$py, Lib/json/encoder$py.class=json.encoder$py, Lib/encodings/iso8859_16$py.class=encodings.iso8859_16$py, Lib/json/tests/test_decode$py.class=json.tests.test_decode$py, Lib/UserString$py.class=UserString$py, Lib/distutils/tests/test_bdist_msi$py.class=distutils.tests.test_bdist_msi$py, Lib/compiler/pycodegen$py.class=compiler.pycodegen$py, Lib/pty$py.class=pty$py, Lib/copy_reg$py.class=copy_reg$py, Lib/xdrlib$py.class=xdrlib$py, Lib/distutils/ccompiler$py.class=distutils.ccompiler$py, Lib/webbrowser$py.class=webbrowser$py, Lib/email/errors$py.class=email.errors$py, Lib/encodings/cp1253$py.class=encodings.cp1253$py, Lib/lib2to3/pgen2/literals$py.class=lib2to3.pgen2.literals$py, Lib/SimpleXMLRPCServer$py.class=SimpleXMLRPCServer$py, Lib/encodings/utf_16_be$py.class=encodings.utf_16_be$py, Lib/tarfile$py.class=tarfile$py, Lib/encodings/undefined$py.class=encodings.undefined$py, Lib/bisect$py.class=bisect$py, Lib/contextlib$py.class=contextlib$py, Lib/difflib$py.class=difflib$py, Lib/distutils/fancy_getopt$py.class=distutils.fancy_getopt$py, Lib/encodings/string_escape$py.class=encodings.string_escape$py, Lib/distutils/tests/setuptools_extension$py.class=distutils.tests.setuptools_extension$py, Lib/runpy$py.class=runpy$py, Lib/encodings/iso8859_11$py.class=encodings.iso8859_11$py, Lib/encodings/cp1251$py.class=encodings.cp1251$py, Lib/unittest/loader$py.class=unittest.loader$py, Lib/distutils/log$py.class=distutils.log$py, Lib/getopt$py.class=getopt$py, Lib/this$py.class=this$py, Lib/lib2to3/main$py.class=lib2to3.main$py, Lib/json/decoder$py.class=json.decoder$py, Lib/encodings/raw_unicode_escape$py.class=encodings.raw_unicode_escape$py, Lib/distutils/tests/test_cmd$py.class=distutils.tests.test_cmd$py, Lib/poplib$py.class=poplib$py, Lib/lib2to3/pgen2/grammar$py.class=lib2to3.pgen2.grammar$py, Lib/distutils/config$py.class=distutils.config$py, Lib/encodings/euc_jis_2004$py.class=encodings.euc_jis_2004$py, Lib/logging/handlers$py.class=logging.handlers$py, Lib/pickle$py.class=pickle$py, Lib/atexit$py.class=atexit$py, Lib/email/test/test_email$py.class=email.test.test_email$py, Lib/_pyio$py.class=_pyio$py, Lib/lib2to3/pygram$py.class=lib2to3.pygram$py, Lib/unittest/main$py.class=unittest.main$py, Lib/email/generator$py.class=email.generator$py, Lib/lib2to3/fixes/fix_ne$py.class=lib2to3.fixes.fix_ne$py, Lib/subprocess$py.class=subprocess$py, Lib/select$py.class=select$py, Lib/encodings/gb2312$py.class=encodings.gb2312$py, Lib/crypt$py.class=crypt$py, Lib/mhlib$py.class=mhlib$py, Lib/urllib2$py.class=urllib2$py, Lib/xml/init$py.class=xml$py, Lib/ast$py.class=ast$py, Lib/pyexpat$py.class=pyexpat$py, Lib/unittest/test/test_loader$py.class=unittest.test.test_loader$py, Lib/heapq$py.class=heapq$py, Lib/encodings/cp861$py.class=encodings.cp861$py, Lib/distutils/command/build$py.class=distutils.command.build$py, Lib/distutils/msvc9compiler$py.class=distutils.msvc9compiler$py, Lib/doctest$py.class=doctest$py, Lib/unittest/test/test_result$py.class=unittest.test.test_result$py, Lib/uu$py.class=uu$py, Lib/encodings/koi8_u$py.class=encodings.koi8_u$py, Lib/encodings/mac_arabic$py.class=encodings.mac_arabic$py, Lib/lib2to3/fixes/fix_intern$py.class=lib2to3.fixes.fix_intern$py, Lib/lib2to3/fixes/fix_renames$py.class=lib2to3.fixes.fix_renames$py, Lib/sre$py.class=sre$py, Lib/unittest/main$py.class=unittest.main$py, Lib/email/mime/text$py.class=email.mime.text$py, Lib/Queue$py.class=Queue$py, Lib/encodings/cp866$py.class=encodings.cp866$py, Lib/lib2to3/fixes/fix_paren$py.class=lib2to3.fixes.fix_paren$py, Lib/numbers$py.class=numbers$py, Lib/distutils/tests/setuptools_build_ext$py.class=distutils.tests.setuptools_build_ext$py, Lib/gzip$py.class=gzip$py, Lib/wsgiref/simple_server$py.class=wsgiref.simple_server$py, Lib/xml/etree/cElementTree$py.class=xml.etree.cElementTree$py, Lib/distutils/command/install_lib$py.class=distutils.command.install_lib$py, Lib/lib2to3/fixes/fix_isinstance$py.class=lib2to3.fixes.fix_isinstance$py, Lib/encodings/johab$py.class=encodings.johab$py, Lib/quopri$py.class=quopri$py, Lib/distutils/tests/test_text_file$py.class=distutils.tests.test_text_file$py, Lib/email/test/test_email_codecs$py.class=email.test.test_email_codecs$py, Lib/wsgiref/util$py.class=wsgiref.util$py, Lib/sysconfig$py.class=sysconfig$py, Lib/compiler/misc$py.class=compiler.misc$py, Lib/distutils/command/install_data$py.class=distutils.command.install_data$py, Lib/pydoc_data/init$py.class=pydoc_data$py, Lib/encodings/iso8859_6$py.class=encodings.iso8859_6$py, Lib/xml/parsers/expat$py.class=xml.parsers.expat$py, Lib/asyncore$py.class=asyncore$py, Lib/distutils/tests/test_sysconfig$py.class=distutils.tests.test_sysconfig$py, Lib/mutex$py.class=mutex$py, Lib/lib2to3/fixes/fix_has_key$py.class=lib2to3.fixes.fix_has_key$py, Lib/unittest/test/support$py.class=unittest.test.support$py, Lib/lib2to3/fixes/fix_basestring$py.class=lib2to3.fixes.fix_basestring$py, Lib/encodings/cp775$py.class=encodings.cp775$py, Lib/email/iterators$py.class=email.iterators$py, Lib/encodings/iso8859_1$py.class=encodings.iso8859_1$py, Lib/StringIO$py.class=StringIO$py, Lib/distutils/bcppcompiler$py.class=distutils.bcppcompiler$py, Lib/logging/init$py.class=logging$py, Lib/lib2to3/fixes/fix_getcwdu$py.class=lib2to3.fixes.fix_getcwdu$py, Lib/lib2to3/fixer_util$py.class=lib2to3.fixer_util$py, Lib/distutils/tests/test_dir_util$py.class=distutils.tests.test_dir_util$py, Lib/encodings/cp858$py.class=encodings.cp858$py, Lib/encodings/mac_iceland$py.class=encodings.mac_iceland$py, Lib/encodings/latin_1$py.class=encodings.latin_1$py, Lib/distutils/tests/test_bdist_wininst$py.class=distutils.tests.test_bdist_wininst$py, Lib/json/tests/test_float$py.class=json.tests.test_float$py, Lib/json/tests/test_fail$py.class=json.tests.test_fail$py, Lib/encodings/hex_codec$py.class=encodings.hex_codec$py, Lib/importlib/init$py.class=importlib$py, Lib/xml/sax/xmlreader$py.class=xml.sax.xmlreader$py, Lib/pycimport$py.class=pycimport$py, Lib/_weakrefset$py.class=_weakrefset$py, Lib/distutils/tests/test_ccompiler$py.class=distutils.tests.test_ccompiler$py, Lib/_threading_local$py.class=_threading_local$py, Lib/types$py.class=types$py, Lib/MimeWriter$py.class=MimeWriter$py, Lib/email/test/init$py.class=email.test$py, Lib/inspect$py.class=inspect$py, Lib/isql$py.class=isql$py, Lib/encodings/big5hkscs$py.class=encodings.big5hkscs$py, Lib/encodings/cp1255$py.class=encodings.cp1255$py, Lib/encodings/cp424$py.class=encodings.cp424$py, Lib/urlparse$py.class=urlparse$py, Lib/encodings/cp874$py.class=encodings.cp874$py, Lib/lib2to3/fixes/fix_filter$py.class=lib2to3.fixes.fix_filter$py, Lib/UserList$py.class=UserList$py, Lib/md5$py.class=md5$py, Lib/unittest/test/test_case$py.class=unittest.test.test_case$py, Lib/encodings/iso8859_15$py.class=encodings.iso8859_15$py, Lib/lib2to3/fixes/fix_imports$py.class=lib2to3.fixes.fix_imports$py, Lib/lib2to3/fixes/fix_ws_comma$py.class=lib2to3.fixes.fix_ws_comma$py, Lib/signal$py.class=signal$py, Lib/xml/dom/init$py.class=xml.dom$py, Lib/ensurepip/main$py.class=ensurepip.main$py, Lib/lib2to3/fixes/fix_standarderror$py.class=lib2to3.fixes.fix_standarderror$py, Lib/distutils/dir_util$py.class=distutils.dir_util$py, Lib/lib2to3/fixes/fix_buffer$py.class=lib2to3.fixes.fix_buffer$py, Lib/lib2to3/btm_utils$py.class=lib2to3.btm_utils$py, Lib/pawt/colors$py.class=pawt.colors$py, Lib/ssl$py.class=ssl$py, Lib/unittest/test/init$py.class=unittest.test$py, Lib/string$py.class=string$py, Lib/zlib$py.class=zlib$py, Lib/email/header$py.class=email.header$py, Lib/sets$py.class=sets$py, Lib/xmllib$py.class=xmllib$py, Lib/encodings/cp1026$py.class=encodings.cp1026$py, Lib/modjy/modjy_wsgi$py.class=modjy.modjy_wsgi$py, Lib/compiler/transformer$py.class=compiler.transformer$py, Lib/fpformat$py.class=fpformat$py, Lib/locale$py.class=locale$py, Lib/colorsys$py.class=colorsys$py, Lib/distutils/unixccompiler$py.class=distutils.unixccompiler$py, Lib/encodings/iso8859_7$py.class=encodings.iso8859_7$py, Lib/lib2to3/fixes/fix_imports2$py.class=lib2to3.fixes.fix_imports2$py, Lib/lib2to3/fixes/fix_sys_exc$py.class=lib2to3.fixes.fix_sys_exc$py, Lib/encodings/cp865$py.class=encodings.cp865$py, Lib/encodings/quopri_codec$py.class=encodings.quopri_codec$py, Lib/encodings/cp1140$py.class=encodings.cp1140$py, Lib/json/tests/test_dump$py.class=json.tests.test_dump$py, Lib/dumbdbm$py.class=dumbdbm$py, Lib/unittest/result$py.class=unittest.result$py, Lib/posixpath$py.class=posixpath$py, Lib/encodings/base64_codec$py.class=encodings.base64_codec$py, Lib/encodings/big5$py.class=encodings.big5$py, Lib/binhex$py.class=binhex$py, Lib/shutil$py.class=shutil$py, Lib/distutils/tests/support$py.class=distutils.tests.support$py, Lib/encodings/hp_roman8$py.class=encodings.hp_roman8$py, Lib/lib2to3/fixes/fix_future$py.class=lib2to3.fixes.fix_future$py, Lib/xml/etree/ElementTree$py.class=xml.etree.ElementTree$py, Lib/distutils/tests/test_build_py$py.class=distutils.tests.test_build_py$py, Lib/distutils/command/register$py.class=distutils.command.register$py, Lib/wsgiref/handlers$py.class=wsgiref.handlers$py, Lib/distutils/command/install$py.class=distutils.command.install$py, Lib/json/tests/test_default$py.class=json.tests.test_default$py, Lib/distutils/tests/test_file_util$py.class=distutils.tests.test_file_util$py, Lib/distutils/tests/test_config_cmd$py.class=distutils.tests.test_config_cmd$py, Lib/token$py.class=token$py, Lib/encodings/cp1257$py.class=encodings.cp1257$py, Lib/unittest/test/test_skipping$py.class=unittest.test.test_skipping$py, Lib/encodings/cp932$py.class=encodings.cp932$py, Lib/encodings/cp852$py.class=encodings.cp852$py, Lib/distutils/tests/test_upload$py.class=distutils.tests.test_upload$py, Lib/json/tests/test_scanstring$py.class=json.tests.test_scanstring$py, Lib/mimify$py.class=mimify$py, Lib/aifc$py.class=aifc$py, Lib/code$py.class=code$py, Lib/email/mime/multipart$py.class=email.mime.multipart$py, Lib/encodings/iso2022_jp_ext$py.class=encodings.iso2022_jp_ext$py, Lib/json/init$py.class=json$py, Lib/lib2to3/pgen2/parse$py.class=lib2to3.pgen2.parse$py, Lib/distutils/debug$py.class=distutils.debug$py, Lib/distutils/tests/test_dist$py.class=distutils.tests.test_dist$py, Lib/distutils/version$py.class=distutils.version$py, Lib/lib2to3/fixes/fix_execfile$py.class=lib2to3.fixes.fix_execfile$py, Lib/profile$py.class=profile$py, Lib/sgmllib$py.class=sgmllib$py, Lib/javapath$py.class=javapath$py, Lib/DocXMLRPCServer$py.class=DocXMLRPCServer$py, Lib/fileinput$py.class=fileinput$py, Lib/base64$py.class=base64$py, Lib/distutils/cygwinccompiler$py.class=distutils.cygwinccompiler$py, Lib/pprint$py.class=pprint$py, Lib/argparse$py.class=argparse$py, Lib/distutils/tests/test_install_headers$py.class=distutils.tests.test_install_headers$py, Lib/imp$py.class=imp$py, Lib/pkgutil$py.class=pkgutil$py, Lib/distutils/emxccompiler$py.class=distutils.emxccompiler$py, Lib/xml/dom/pulldom$py.class=xml.dom.pulldom$py, Lib/calendar$py.class=calendar$py, Lib/re$py.class=re$py, Lib/compiler/init$py.class=compiler$py, Lib/json/scanner$py.class=json.scanner$py, Lib/distutils/tests/test_bdist$py.class=distutils.tests.test_bdist$py, Lib/lib2to3/fixes/fix_exec$py.class=lib2to3.fixes.fix_exec$py, Lib/xml/sax/saxutils$py.class=xml.sax.saxutils$py, Lib/csv$py.class=csv$py, Lib/pstats$py.class=pstats$py, Lib/imaplib$py.class=imaplib$py, Lib/encodings/cp869$py.class=encodings.cp869$py, Lib/lib2to3/btm_matcher$py.class=lib2to3.btm_matcher$py, Lib/distutils/tests/test_register$py.class=distutils.tests.test_register$py, Lib/encodings/charmap$py.class=encodings.charmap$py, Lib/encodings/iso2022_jp_3$py.class=encodings.iso2022_jp_3$py, Lib/uuid$py.class=uuid$py, Lib/bdb$py.class=bdb$py, Lib/grp$py.class=grp$py, Lib/distutils/command/build_py$py.class=distutils.command.build_py$py, Lib/urllib$py.class=urllib$py, Lib/pwd$py.class=pwd$py, Lib/dbexts$py.class=dbexts$py, Lib/random$py.class=random$py, Lib/distutils/command/bdist_wininst$py.class=distutils.command.bdist_wininst$py, Lib/dummy_thread$py.class=dummy_thread$py, Lib/unittest/suite$py.class=unittest.suite$py, Lib/xml/etree/init$py.class=xml.etree$py, Lib/encodings/mac_turkish$py.class=encodings.mac_turkish$py, Lib/lib2to3/fixes/fix_set_literal$py.class=lib2to3.fixes.fix_set_literal$py, Lib/shlex$py.class=shlex$py, Lib/distutils/command/bdist_dumb$py.class=distutils.command.bdist_dumb$py, Lib/htmlentitydefs$py.class=htmlentitydefs$py, Lib/json/tests/test_pass3$py.class=json.tests.test_pass3$py, Lib/encodings/utf_8$py.class=encodings.utf_8$py, Lib/distutils/jythoncompiler$py.class=distutils.jythoncompiler$py, Lib/lib2to3/fixes/fix_raise$py.class=lib2to3.fixes.fix_raise$py, Lib/lib2to3/refactor$py.class=lib2to3.refactor$py, Lib/compiler/consts$py.class=compiler.consts$py, Lib/lib2to3/fixes/fix_funcattrs$py.class=lib2to3.fixes.fix_funcattrs$py, Lib/lib2to3/fixes/fix_metaclass$py.class=lib2to3.fixes.fix_metaclass$py, Lib/encodings/cp1252$py.class=encodings.cp1252$py, Lib/compiler/symbols$py.class=compiler.symbols$py, Lib/email/mime/base$py.class=email.mime.base$py, Lib/ntpath$py.class=ntpath$py, Lib/pickletools$py.class=pickletools$py, Lib/encodings/koi8_r$py.class=encodings.koi8_r$py, Lib/lib2to3/main$py.class=lib2to3.main$py, Lib/lib2to3/patcomp$py.class=lib2to3.patcomp$py, Lib/getpass$py.class=getpass$py, Lib/htmllib$py.class=htmllib$py, Lib/imghdr$py.class=imghdr$py, Lib/modjy/modjy_impl$py.class=modjy.modjy_impl$py, Lib/distutils/command/init$py.class=distutils.command$py, Lib/trace$py.class=trace$py, Lib/unittest/test/test_program$py.class=unittest.test.test_program$py, Lib/encodings/iso2022_jp_1$py.class=encodings.iso2022_jp_1$py, Lib/distutils/tests/test_versionpredicate$py.class=distutils.tests.test_versionpredicate$py, Lib/javashell$py.class=javashell$py, Lib/tokenize$py.class=tokenize$py, Lib/distutils/tests/test_version$py.class=distutils.tests.test_version$py, Lib/distutils/tests/test_unixccompiler$py.class=distutils.tests.test_unixccompiler$py, Lib/macurl2path$py.class=macurl2path$py, Lib/nntplib$py.class=nntplib$py, Lib/encodings/mac_cyrillic$py.class=encodings.mac_cyrillic$py, Lib/ctypes/init$py.class=ctypes$py, Lib/encodings/unicode_internal$py.class=encodings.unicode_internal$py, Lib/lib2to3/pgen2/driver$py.class=lib2to3.pgen2.driver$py, Lib/future$py.class=future$py, Lib/pipes$py.class=pipes$py, Lib/email/charset$py.class=email.charset$py, Lib/lib2to3/fixes/fix_zip$py.class=lib2to3.fixes.fix_zip$py, Lib/distutils/command/sdist$py.class=distutils.command.sdist$py, Lib/encodings/mac_farsi$py.class=encodings.mac_farsi$py, Lib/xmlrpclib$py.class=xmlrpclib$py, Lib/whichdb$py.class=whichdb$py, Lib/mimetypes$py.class=mimetypes$py, Lib/encodings/shift_jisx0213$py.class=encodings.shift_jisx0213$py, Lib/encodings/mac_latin2$py.class=encodings.mac_latin2$py, Lib/distutils/tests/test_install_scripts$py.class=distutils.tests.test_install_scripts$py, Lib/cookielib$py.class=cookielib$py, Lib/BaseHTTPServer$py.class=BaseHTTPServer$py, Lib/distutils/tests/test_core$py.class=distutils.tests.test_core$py, Lib/modjy/modjy_input$py.class=modjy.modjy_input$py, Lib/hmac$py.class=hmac$py, Lib/encodings/gb18030$py.class=encodings.gb18030$py, Lib/encodings/gbk$py.class=encodings.gbk$py, Lib/encodings/cp850$py.class=encodings.cp850$py, Lib/lib2to3/init$py.class=lib2to3$py, Lib/distutils/command/build_ext$py.class=distutils.command.build_ext$py, Lib/json/tests/test_unicode$py.class=json.tests.test_unicode$py, Lib/timeit$py.class=timeit$py, Lib/encodings/iso8859_9$py.class=encodings.iso8859_9$py, Lib/marshal$py.class=marshal$py, Lib/encodings/mac_roman$py.class=encodings.mac_roman$py, Lib/unittest/test/dummy$py.class=unittest.test.dummy$py, Lib/distutils/tests/test_build_clib$py.class=distutils.tests.test_build_clib$py, Lib/lib2to3/fixes/fix_import$py.class=lib2to3.fixes.fix_import$py, Lib/distutils/tests/init$py.class=distutils.tests$py, Lib/decimal$py.class=decimal$py, Lib/fnmatch$py.class=fnmatch$py, Lib/distutils/tests/test_build_scripts$py.class=distutils.tests.test_build_scripts$py, Lib/_socket$py.class=_socket$py, Lib/unittest/test/test_functiontestcase$py.class=unittest.test.test_functiontestcase$py, Lib/distutils/errors$py.class=distutils.errors$py, Lib/glob$py.class=glob$py, Lib/xml/parsers/init$py.class=xml.parsers$py, Lib/email/test/test_email_renamed$py.class=email.test.test_email_renamed$py, Lib/encodings/cp863$py.class=encodings.cp863$py, Lib/encodings/cp860$py.class=encodings.cp860$py, Lib/xml/etree/ElementInclude$py.class=xml.etree.ElementInclude$py, Lib/distutils/spawn$py.class=distutils.spawn$py, Lib/wsgiref/init$py.class=wsgiref$py, Lib/httplib$py.class=httplib$py, Lib/email/mime/audio$py.class=email.mime.audio$py, Lib/lib2to3/fixes/fix_types$py.class=lib2to3.fixes.fix_types$py, Lib/_google_ipaddr_r234$py.class=_google_ipaddr_r234$py, Lib/distutils/tests/test_config$py.class=distutils.tests.test_config$py, Lib/lib2to3/fixes/fix_raw_input$py.class=lib2to3.fixes.fix_raw_input$py, Lib/distutils/tests/test_build_ext$py.class=distutils.tests.test_build_ext$py, Lib/encodings/shift_jis$py.class=encodings.shift_jis$py, Lib/weakref$py.class=weakref$py, Lib/json/tests/test_speedups$py.class=json.tests.test_speedups$py, Lib/json/tests/test_encode_basestring_ascii$py.class=json.tests.test_encode_basestring_ascii$py, Lib/encodings/ascii$py.class=encodings.ascii$py, Lib/encodings/euc_kr$py.class=encodings.euc_kr$py, Lib/keyword$py.class=keyword$py, Lib/distutils/command/install_scripts$py.class=distutils.command.install_scripts$py, Lib/distutils/command/build_scripts$py.class=distutils.command.build_scripts$py, Lib/distutils/tests/test_sdist$py.class=distutils.tests.test_sdist$py}

Obviously, it is the generated classes for the Python standard library that is causing the trouble. OSGI expects the package name in the class metadata to match the path in the JAR, so the extra Lib folder does not comply with this requirement.

There are some workarounds reported online. One uses a kind of bridge or shim as shown in this blog, but that is for 2.5.x. The author reports that the design should be compatible with later versions, but also that it doesn't fit the philosophy of OSGI. I'm not sure if I want to go down that road.

Another effort to repackage Jython for OSGI here, currently using a copy of an earlier beta of 2.7.1, but I didn't try it. It appears to be built specifically for use in a specialized scientific platform, OpenGDA, which is GPL. I'd rather just be able to grab the standard build from Maven and not worry about it.

If I exclude the Lib folder from my bundle, I can at least get it to build without error, but the result isn't very useful. A key advantage of Jython over other scripting engines, for me at least, is that library.

Is there, or can there be implemented, a supported, proper way to make Jython and its standard library available in an OSGI container, without incurring additional maintenance overhead for developers using Jython?

Not open jython interpreter when i am using java -jar

Hello there. when i run PS C:\Users\ByRfb\Desktop\jython> java -jar .\jython-standalone-2.7.1.jar .\deneme.py
and i except this what is the problem ?

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.python.core.PyType.init(PyType.java:633)
at org.python.core.PyType.createType(PyType.java:1523)
at org.python.core.PyType.addFromClass(PyType.java:1462)
at org.python.core.PyType.fromClass(PyType.java:1551)
at org.python.core.PyType.fromClass(PyType.java:1536)
at org.python.core.PyStringMap.getLazyType(PyStringMap.java:68)
at org.python.core.PyStringMap.(PyStringMap.java:48)
at org.python.core.PyStringMap.(PyStringMap.java:44)
at org.python.expose.BaseTypeBuilder.getDict(BaseTypeBuilder.java:49)
at org.python.core.PyType.init(PyType.java:621)
at org.python.core.PyType.addBuilder(PyType.java:1452)
at org.python.core.PyType.(PyType.java)
at org.python.core.PyObject.(PyObject.java:93)
at org.python.core.PyBuiltinCallable.(PyBuiltinCallable.java:22)
at org.python.core.PyBuiltinMethod.(PyBuiltinMethod.java:16)
at org.python.core.PyBuiltinMethodNarrow.(PyBuiltinMethodNarrow.java:23)
at org.python.core.PyDataDescr$getset_descriptor___get___exposer.(Unknown Source)
at org.python.core.PyDataDescr$PyExposer.(Unknown Source)
at org.python.core.PyDataDescr.(PyDataDescr.java)
at org.python.core.PyBuiltinCallable$PyExposer.(Unknown Source)
at org.python.core.PyBuiltinCallable.(PyBuiltinCallable.java)
at org.python.core.PyObject$PyExposer.(Unknown Source)
at org.python.core.PyObject.(PyObject.java)
at org.python.util.jython.run(jython.java:241)
at org.python.util.jython.main(jython.java:142)
Caused by: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value
at org.python.core.PyString.(PyString.java:57)
at org.python.core.PyString.(PyString.java:70)
at org.python.core.PyString.(PyString.java:74)
at org.python.core.Py.newString(Py.java:647)
at org.python.core.PyJavaType.init(PyJavaType.java:585)
at org.python.core.PyType.createType(PyType.java:1523)
at org.python.core.PyType.addFromClass(PyType.java:1462)
at org.python.core.PyType.fromClass(PyType.java:1551)
at org.python.core.PyObject.(PyObject.java:93)
at org.python.core.PySingleton.(PySingleton.java:9)
at org.python.core.PyNotImplemented.(PyNotImplemented.java:10)
at org.python.core.Py.(Py.java:94)
... 25 more

Swap from hg to git as our SCM tool

Migration to GitHub includes a switch from Mercurial to Git. The consequences of this are:

  1. (following CPython's lead) is to withdraw sys._mercurial in favour of sys._git to represent build metadata.
  2. Changes to the Ant and Gradle builds to refer to Git for metadata and validation of a release.

I have dry run this at https://github.com/jeff5/jython-nightjar and change sets 31 May 2020 to 3 June,
although a single change is preferable now we know the end-state.

Future of Jython

Just curious as to the roadmap for this implementation of Python given that Python 2 is at the end of its life very soon.

Will there be an implementation for Python 3 worked on? Python 3.8 provides many improvements and new features over Python 2.7, such as asyncio (perhaps able to beef this up using something similar to reactor 3 depending on how you implement it?), type hints and type checking, format strings, new operators, a more beginner friendly interface for making classes and inheritance-based graphs (default of inheriting from object, not type, etc)

For a new project, it would make sense for a developer to not want to work with a standard of Python that is at the end of its life, as it has implications for forwards compatibility and future ability to receive security updates for any dependencies and components pulled off of repositories such as PyPI.

Is there a use case for a new developer wanting to use Python via Jython, or is it supported for legacy only at this point?

cannot access class sun.security.ssl.SSLEngineImpl

Trying to pip install from open jdk 9 I get

$ ~/Software/jython-2.7.2/bin/pip install --trusted-host pypi.python.org --upgrade virtualenv==16.5.0
org.python.netty.util.internal.PlatformDependent INFO Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
DEPRECATION: A future version of pip will drop support for Python 2.7.
Collecting virtualenv==16.5.0
Traceback (most recent call last):
File "/home/me/Software/jython-2.7.2/bin/pip", line 10, in <module>
    sys.exit(main())
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/__init__.py", line 78, in main
    return command.main(cmd_args)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/cli/base_command.py", line 230, in main
    pip_version_check(session, options)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/utils/outdated.py", line 132, in pip_version_check
    candidate = finder.find_candidates("pip").get_best()
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/utils/outdated.py", line 132, in pip_version_check
    candidate = finder.find_candidates("pip").get_best()
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/index.py", line 750, in find_candidates
    return FoundCandidates.from_specifier(
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/index.py", line 715, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/index.py", line 845, in _get_pages
    page = _get_html_page(location, session=self.session)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/index.py", line 231, in _get_html_page
    resp = _get_html_response(url, session=session)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/index.py", line 231, in _get_html_page
    resp = _get_html_response(url, session=session)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/index.py", line 162, in _get_html_response
    resp = session.get(
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_internal/download.py", line 439, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py", line 53, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py", line 597, in urlopen
    httplib_response = self._make_request(conn, method, url,
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py", line 597, in urlopen
    httplib_response = self._make_request(conn, method, url,
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/connection.py", line 337, in connect
    self.sock = ssl_wrap_socket(
File "/home/me/Software/jython-2.7.2/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
File "/home/me/Software/jython-2.7.2/Lib/ssl.py", line 1075, in wrap_socket
    return SSLSocket(sock=sock, server_side=server_side,
File "/home/me/Software/jython-2.7.2/Lib/ssl.py", line 577, in __init__
    self.do_handshake()
File "/home/me/Software/jython-2.7.2/Lib/ssl.py", line 668, in do_handshake
    self.setup_engine(self.sock.getpeername())
File "/home/me/Software/jython-2.7.2/Lib/ssl.py", line 609, in setup_engine
    self.engine.setUseClientMode(not self.server_side)
    at sun.reflect.Reflection.throwIllegalAccessException(java.base@9-internal/Reflection.java:411)
    at sun.reflect.Reflection.throwIllegalAccessException(java.base@9-internal/Reflection.java:402)
    at sun.reflect.Reflection.ensureMemberAccess(java.base@9-internal/Reflection.java:99)
    at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(java.base@9-internal/AccessibleObject.java:355)
    at java.lang.reflect.AccessibleObject.checkAccess(java.base@9-internal/AccessibleObject.java:347)
    at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:525)
java.lang.IllegalAccessException: java.lang.IllegalAccessException: class org.python.core.PyReflectedFunction cannot access class sun.security.ssl.SSLEngineImpl (in module java.base) because module java.base does not export sun.security.ssl to unnamed module @6d815fb7
me@lap440 ~ $ java -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
me@lap440 ~ $ 

Transfer closed-fixed issues in NEWS from frozen-mirror

Until recently, issues were accepted on https://github.com/jythontools/jython (now https://github.com/jython/frozen-mirror) and PRs there were transferred as patches onto https://hg.python.org/jython .

The record in NEWS will sometimes contain the GitHub issue number in the old repo, where you wouldn't expect to look. We'd like it to refer readers to an issue in this repo. Therefore we need for each affected issue to:

  1. Preserve the issue number in frozen-mirror in the issue text somehow.
  2. Transfer the issue to this repo.
  3. Translate the old number to the new one so NEWS correlates correctly with the issue.

We probably can't do anything about GH issue numbers in change sets.

Check the contributors are correctly counted

Check the contributors are correctly counted by association with their accounts where possible. (Need the repo to be public to show that.)

It is not possible in all cases, including some illustrious ones: we have to be content with the e-mail address.

Encoding of files in codecs lib 2.7.2b2

Writing a file in a encoding not utf-8 with codecs lib, it always write file in utf-8.

Jython 2.7.2b2 (v2.7.2b2:b9b60766cabe, Nov 1 2019, 07:46:45)
[OpenJDK 64-Bit Server VM (Private Build)] on java11.0.5
Type "help", "copyright", "credits" or "license" for more information.

import codecs
f = codecs.open("/tmp/a.tmp","w",encoding='cp1252')
f.write(u"áó")
f.close()

○ → cat /tmp/a.tmp
áó

→ file /tmp/a.tmp
/tmp/a.tmp: UTF-8 Unicode text, with no line terminator

○ → cat /etc/release |grep DISTRIB
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
`

This was not happening in previous versions.
`Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43)
[OpenJDK 64-Bit Server VM (Private Build)] on java11.0.5
Type "help", "copyright", "credits" or "license" for more information.

import codecs
f = codecs.open("/tmp/a.tmp","w",encoding='cp1252')
f.write(u"áó")
f.close()

py-2.7.17 ismael-work in ~/jython2.7.1/bin
○ → file /tmp/a.tmp
/tmp/a.tmp: ISO-8859 text, with no line terminators`

Update Darwin jffi library dependency

Hi,

you need to update your Darwin jffi library dependency to at least version 1.2.23 as noted here. Otherwise users will not be able to notarize your releases for usage on latest MAC OS X operating systems.

jython-standalone-2.7.2.jar release is affected by this issue and fails notarization unless you manually replace the libjffi-1.2.jnilib file supplied within the JAR (not sure if safe to do).

Cannot use a JSR223 javax.script.filename value containing an UTF8 character

When using Jython trough the JSR223 API and setting a "javax.script.filename" atrribute to something like "β" for example we end u with the following error:

java.lang.IllegalArgumentException: Cannot create PyString with non-byte value
	at org.python.core.PyString.<init>(PyString.java:57)
	at org.python.core.PyString.<init>(PyString.java:70)
	at org.python.core.PyString.<init>(PyString.java:74)
	at org.python.core.Py.newString(Py.java:643)
	at org.python.jsr223.PyScriptEngine.compileScript(PyScriptEngine.java:89)
	at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
	at org.xwiki.rendering.macro.script.AbstractJSR223ScriptMacro.eval(AbstractJSR223ScriptMacro.java:351)
	[...]

Question: non interruptible I/O in Jython

In my company, we are developing small OpenSource libraries in various technologies (currently Java, .NET, C++ with C wrappers).
To be able to test those libraries with the same set of test scripts, we have chosen to use Python with various interpreters, based on the underlying technology (Jython, IronPython, CPython). We have created small wrappers wrapping our underlying libraries, which behave basically the same, independent of the used technology.

To be able to handle logging in our libs we have an interface in each lib, which the users of our libs can implement. In case of our tests, we have an implementation in the appropriate Python wrapper, wrapping to Python's logging.Logger. In case of Jython we instantiate a logging.Logger with a logging.StreamHandler and a logging.handlers.TimedRotatingFileHandler.

Basically, all works fine until we shut down our code. In this shutdown routine, a thread gets interrupted that was started before. Now this thread, which got interrupted, logs a message, which is passed on Jython logging and to the stream handler. Since the thread calling the log method got interrupted, the write operation gets interrupted and the stream closed. When we repeat our tests in an endless loop - inside the loop we are doing setup, execute and teardown - the logging.StreamHandler does not print any further output to the console, since sys.stderr got closed in the first tear down.

Coming to my question: Is there any way how I can configure Jython to use non-interruptible I/O so that the streams do not get closed?

Currently, I have implemented a workaround, by implementing the Handlers on my own and working directly with Java's I/O.

http connection hangs

Im making a http connection with method POST to send a file (using httplib/urllib2) and if it is over 64KB (approximately) the response is never received and the code hangs forever.

It happens from jython-standalone-2.7.1-rc2.jar, if i use jython-standalone-2.7.1b3, it works fine.
I have done some tests and if i overwrite the _socket.py with the 2.7.1b3 version, then it works, so i suppose is a different implementation in newer versions which cause the problem.

Also i had check the TCP packets with Wireshark and the response packets from the server is never received, so seems problem when sending the data.

How I can fill a JavaFX TableView using Jython?

I do not know if it is a issue or if something is missing at the code, but TableView is not showing the data that I pass. Follow the code:

FXML:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="335.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" stylesheets="@style.css">
    <center>
        <VBox BorderPane.alignment="CENTER">
            <children>
                <ScrollPane>
                    <content>
                        <VBox>
                            <children>
                                <TableView fx:id="tblProduct" prefHeight="270.0" prefWidth="335.0">
                                    <columns>
                                        <TableColumn fx:id="colProductAmount" prefWidth="64.0" text="Amount" />
                                        <TableColumn fx:id="colProductId" prefWidth="64.0" text="ID" />
                                        <TableColumn fx:id="colProductDescription" prefWidth="192.0" text="Description" />
                                    </columns>
                                    <padding>
                                        <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
                                    </padding>
                                </TableView>
                            </children>
                        </VBox>
                    </content>
                </ScrollPane>
            </children>
        </VBox>
    </center>
</BorderPane>

Controller:

from javafxjython import (EventHandler, FXMLLoader)
from javafx.scene import Scene
from javafx.scene.layout import BorderPane
from javafx.beans.property import (SimpleIntegerProperty, SimpleStringProperty)

from javafx.collections import (FXCollections, ObservableList)
from javafx.scene.control.cell import PropertyValueFactory

from javafx.fxml import Initializable


class ProductReport():
    def __init__(self, amount, id, description):
        self.amount = SimpleIntegerProperty(amount)
        self.id = SimpleIntegerProperty(id)
        self.description = SimpleStringProperty(description)

    def getAmount(self):
        return self.amount.get()

    def setAmount(self, value):
        self.amount = SimpleIntegerProperty(value)

    def amountProperty(self):
        return self.amount

    def getId(self):
        return self.id.get()

    def setId(self, value):
        self.id = SimpleIntegerProperty(value)

    def idProperty(self):
        return self.id

    def getDescription(self):
        return self.description.get()

    def setDescription(self, value):
        self.description = SimpleStringProperty(value)

    def amountDescription(self):
        return self.description


class ProductController(FXMLLoader, BorderPane, Initializable):
    # second class must, be the same as root in FXML file
    def __init__(self):
        super(ProductController, self).__init__("view/product.fxml")  # FXML file to load
        self.colProductAmount.setCellValueFactory(PropertyValueFactory("amount"))
        self.colProductId.setCellValueFactory(PropertyValueFactory("id"))
        self.colProductDescription.setCellValueFactory(PropertyValueFactory("description"))
        data = FXCollections.observableArrayList()
        data.add(ProductReport(1, 33, "A"))
        data.add(ProductReport(1, 66, "B"))
        data.add(ProductReport(1, 99, "C"))
        self.tblProduct.setItems(data)

    def initialize(self, location, resources):
        pass

Main class:

from javafxjython import (Application, EventHandler, FXMLLoader)
from javafx.scene import Scene
from controllers  import ProductController

class Main(Application):
def __init__(self):
    self.title = "JavaFX Test"

def start(self, stage):
    stage.setTitle(self.title)
    stage.setScene(Scene(ProductController(stage), 335, 400))
    stage.show()


if __name__ == "__main__":
Application.launch(Main)

The only problem with it is: the product list is not appearing at table.

The table renderizes like it has data to show but nothing is showed.

Someone knows where is the mistake?

Please, help me.

PS: I am using javafxjython library project from GitHub (https://github.com/f-lima/javafx-jython) to load and create all components inside FXML into my controller class.

socket.AF_UNIX

First, thanks for your work on jython.

Would it be possible to add AF_UNIX to the socket module?

>>> import socket
>>> socket.AF_UNIX
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'AF_UNIX'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.