Changelog History
Page 1
-
v1.2.0 Changes
November 30, 2020โ Added builds for Python 3.9. Python 3.9 on Windows is currently failing
due to issue in Python.๐ Fixed bug when importing from multi-release jars. The directory was
being truncated to only those classes in the overlay.โ addClassPath can add jar files after the JVM is started. The default
loader for JPype class isorg.jpype.classloader.DynamicClassLoader
.๐ Build support of z/OS added.
๐ Bug causing ambiguity between primitives and variadic arguments in method
resolution was corrected.Boolean was inadvertently left out of method resolution.
boolean
now properly matched with boxed types.๐ Support for PyInstaller was added.
-
v1.1.2 Changes
October 23, 2020๐ง Linux binaries are now stripped for size.
โ Add importlib.util to address instability in Python importlib boot process.
Certain versions of Python such as 3.9 appear to not properly load this
module resulting in unexpected errors during startJVM. -
v1.1.1 Changes
October 21, 2020๐ This pull release corrects an issue in the build system resulting in incomplete wheels on linux. No other changes from 1.1.0.
-
v1.1.0 Changes
October 20, 2020linux distribution were incomplete. Please use 1.1.1 release.
Correct bug resulting in reporting ambiguous overloads when resolving
methods with variadic arguments.Ctrl+C behavior is switchable with interrupt flag to startJVM.
If True, process will halt on Ctrl-C. If False, the process
will transfer control to Python rather than halting. If
not specified JPype will assume false if Python is started as an
interactive shell.๐ Fixed crash with Ctrl+C when multiple exceptions were generated.
โ Removed extraneous exception when calling Ctrl+C before Java code is
executed for methods and fields.๐ Fixed memory leak with string cache.
๐ Fixed crash when manually creating wrappers for anonymous classes.
๐ Fixed reference count problem in stackframes used for exceptions.
Errors report
*static*
when the matching with a static method
so that it is clear when a member method was called statically.java.lang.String slices function like Python string slice.
๐ฆ Java packages now operate as normal Python modules. Removed restrictions
๐ฆ regarding setattr. All package instances for the same package name are
shared so that functionality added to one instance is shared wiht all
instances. -
v1.0.2 Changes
July 31, 2020The wrapper for Throwable was getting the wrapper for Object rather than
the expected wrapper resulting in odd conversions from Python classes.โ๏ธ Typos within the import system resulting in "jname" not found corrected.
C propagates to a KeyboardInterrupt properly.
โ Added cache to the method dispatch to bypass resolution of overloads.
This reduces the cost of method resolution significantly especially if
the same overload is hit repeatedly such as during loop operations.๐ Improved speed on transfer of lists, tuples, buffers to arrays of Java
primitives by a factor of 4 to 100 depending on the data type. The
โก๏ธ conversion uses optimized path for memory buffers, rather than the
Sequence API. When a Python buffer is encountered only the
first element is checked for conversion as Python buffers are homogeneous.Corrected symbol problem with Python 3.5.3. PySlice_Unpack was introduced
๐ in a later patch release and should not have been used.shutdown The behavior log entry for changes on shutdown were lost in
๐ the 1.0 release. JPype now calls the JVM shutdown routine which tries to
gracefully exit when shutdown is called. This results in several changes
in behavior. Non daemon threads can now hold open the JVM until they have
completed. Proxy calls will hold the shutdown until the call is completed
but will receive an interrupt message. Files now close properly and will
๐ป flush if the threads properly handle the exception. Resource clean up
hooks and finalizers are executed. AtExit hooks in the JVM are called as
spawned threads. Automatic attachment of threads by use of the JVM from
Python are done as daemon but can be reattached as user threads on demand.
๐ Buggy code that fails to properly handle thread clean up will likely hang
๐ on shutdown. Additional documentation is located in the user guide.A bug was reported with numpy.linalg.inv resulting in crashes. This was
traced to an interaction with threading between the JVM and some compilations
โช of numpy. The workaround appears to be calling numpy.linalg.inv prior to
starting the JVM.special note To all our friends on opennet.ru, please blame not the translator. Translating my mangled English diction and word order is torture enough. Dyslexics of the world untie!
-
v1.0.1 Changes
July 16, 2020๐ This is a single issue patch release for compatibility with Python 3.8.4.
- Workarounds for Python 3.8.4 release. Python altered logic regarding the use of
__setattr__
for object and type, preventing it from being used to alter derived classes. Also the checking for errors was delegated from the__setattr__
method so exception types on some sanity checks needed to be updated accordingly.
- Workarounds for Python 3.8.4 release. Python altered logic regarding the use of
-
v1.0.0 Changes
July 15, 2020๐
JChar
is supported as a return type, thus rather than returning a string where aJChar
is expected. For compatibilityJChar
is
derived fromstr
and implements implicit conversion to anint
when used in numeric operations. Therefore, it passes the return, argument, and field contracts. But that means it is no longer considered a numerical type to Python and thusisinstance(c, int)
is False. This is consistent with the Java type conversion rules.๐ Introduced Python operator for Java casting. In Java to cast to a type you would use
(Type) obj
, but Python does not support anything similar. Therefore, we are enlisting the rarely usedmatmul
operator as to allow an easy way to cast an object to a Java type. When a cast to a Java type is required, useType@obj
or(Type)@obj
.๐ Introduced array notation to create Java arrays. In earlier versions, JArray factory was required to make a new array type. But this is tedious to read. In Java the notation would be
Type[]
to declare a type ornew Type[sz]
to make a new array. Python does not directly support this notation, but it does allow for unspecified array sizes using a slice. All Java class types supportType[sz]
to create an array of a fixed size andType[:]
to create an array type which can be instantiated later. This call be applied to multiple dimensions to create fixed sized arraysType[s1][s2][s3]
to declare multi-dimension array typesType[:][:][:]
or to create a new multi dimensional array with unspecified dimensionsType[sz][:][:]
. Applying a slice with limits to a class is unsupported.Java classes annotated with
@FunctionalInterface
can be converted from any Python object that implements__call__
. This allows functions, lambdas, and class constructors to be used whereever Java accepts a lambda.0๏ธโฃ Deprecated class and functions were removed.
JIterator
, use ofJException
as a factory,get_default_jvm_path
,jpype.reflect
module.0๏ธโฃ Default for starting JVM is now to return Java strings rather than convert.
Python deprecated
__int__
so implicit conversions between float and integer types will produce aTypeError
.โ Use of
JException
is discouraged. To catch all exceptions or test if an object is a Java exception type, usejava.lang.Throwable
.๐ป Chained Java exception causes are now reflected in the Python stackframes.
โ Use of
JString
is discouraged. To create a Java string or test if an object is a Java string type, usejava.lang.String
.โก๏ธ Updated the repr methods on Java classes.
java.util.List
completes the contract forcollections.abc.Sequence
andcollections.abc.MutableSequence
.java.util.Collection
completes the contract forcollections.abc.Collection
.Java classes are closed and will raise
TypeError
if extended in Python.๐ฆ Handles Control-C gracefully. Previous versions crash whenever Java handles the Control-C signal as they would shutdown Java during a call. Now JPype will produce a
InterruptedException
when returning from Java. Control-C will not break out of large Java procedures as currently implemented as Java does not have a specific provision for this. -
v0.7.5 Changes
May 13, 2020๐ This release is to fix an issue in which the development release was accidentally published as the source release on PyPi. v0.7.4 built from source from PyPi and on the Anaconda distributions should be replaced with this version. Changes in this release include
- ๐ Updated documentation
- ๐ A revised release and testing process which should prevent similar issues in the future
-
v0.7.4 Changes
April 29, 2020๐ This is a quick fix release to deal with a memory leak in array handling which allowed arrays to escape garbage collection when created from Python or as part of variable argument methods.
Corrected a resource leak in arrays that affects array initialization, and variable
argument methods.โฌ๏ธ Upgraded diagnostic tracing and JNI checks to prevent future resource leaks.
-
v0.7.3 Changes
April 21, 2020๐ This is a maintenance release correcting a number of issues from NumPy removal. Yet another stepping stone on the way to 1.0.
Replaced type management system , memory management for internal
classes is now completely in Java to allow enhancements for
๐ buffer support and revised type conversion system.๐ Python module
jpype.reflect
will be removed in the next release.0๏ธโฃ
jpype.startJVM
optionconvertStrings
default will become False
๐ in the next release.๐ท Undocumented feature of using a Python type in
JObject(obj, type=tp)
๐ is deprecated to support casting to Python wrapper types in Java in a
๐ future release.โฌ๏ธ Dropped support for Cygwin platform.
JFloat
properly follows Java rules for conversion fromJDouble
.
Floats outside of range map to inf and -inf.java.lang.Number
converts automatically from Python and Java numbers.
Java primitive types will cast to their proper box type when passed
to methods and fields taking Number.java.lang.Object
andjava.lang.Number
box signed, sized numpy types
(int8, int16, int32, int64, float32, float64) to the Java boxed type
with the same size automatically. Architecture dependent numpy
types map to Long or Double like other Python types.Explicit casting using primitives such as JInt will not produce an
OverflowError
. Implicit casting from Python types such as int or float
will.Returns for number type primitives will retain their return type
information. These are derived from Pythonint
andfloat
types
thus no change in behavior unless chaining from a Java methods
which is not allowed in Java without a cast.
JBoolean
andJChar
still produce Python types only.โ Add support for direct conversion of multi-dimensional primitive arrays
withJArray.of(array, [dtype=type])
java.nio.Buffer
derived objects can convert to memoryview if they
are direct. They can be converted to NumPy arrays with
numpy.asarray(memoryview(obj))
.Proxies created with
@JImplements
properly implementtoString
,
hashCode
, andequals
.Proxies pass Python exceptions properly rather converting to
java.lang.RuntimeException
JProxy.unwrap()
will return the original instance object for proxies
created with JProxy. Otherwise will return the proxy.JProxy instances created with the
convert=True
argument will automatic
unwrap when passed from Java to Python.JProxy only creates one copy of the invocation handler per
garbage collection rather than once per use. Thus proxy objects
placed in memory containers will have the same object id so long
as Java holds on to it.@JImplements
with keyword argumentdeferred
can be started
prior to starting the JVM. Methods are checked at first object
creation.๐ Fix bug that was causing
java.lang.Comparable
,byte[]
,
andchar[]
to be unhashable.๐ Fix bug causing segfault when throwing Exceptions which lack a
0๏ธโฃ default constructor.๐ Fixed segfault when methods called by proxy have incorrect number of
arguments.๐ Fixed stack overflow crash on iterating ImmutableList
java.util.Map
conforms to Pythoncollections.abc.Mapping
API.java.lang.ArrayIndexOutOfBoundsException
can be caught with
๐ปIndexError
for consistency with Python exception usage.java.lang.NullPointerException
can be caught withValueError
๐ป for consistency with Python exception usage.Replaced type conversion system , type conversions test conversion
once per type improving speed and increasing flexiblity.๐ User defined implicit conversions can be created with
@JConversion
decorator on Python function taking Java class and Python object.
Converter function must produce a Java class instance.pathlib.Path
can be implicitly converted intojava.lang.File
andjava.lang.Path
.datetime.datatime
can implicitly convert tojava.time.Instant
.dict
andcollections.abc.Mapping
can convert tojava.util.Map
if all element are convertable to Java. Otherwise,TypeError
is
raised.list
andcollections.abc.Sequence
can convert tojava.util.Collection
if all elements are convertable to Java. Otherwise,TypeError
is
raised.