Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module #1249

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open

Module #1249

Changes from 2 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
eacc1fe
Work on module support
Thrameos Nov 27, 2024
3ef37ba
Remove agent logic trying to resolve non ascii
Thrameos Nov 27, 2024
4766f12
Cleanup and work for nonascii friends
Thrameos Nov 27, 2024
6387988
Ready for merge
Thrameos Nov 27, 2024
95346dc
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 27, 2024
6950c29
Fixed bug in the order of operations
Thrameos Nov 27, 2024
cc63e92
Fix warning
Thrameos Nov 28, 2024
df0f73b
No need to make an extra class loader.
Thrameos Nov 28, 2024
f828f80
Push to test removal
Thrameos Nov 28, 2024
1265979
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 28, 2024
70cc3c1
Merging from main
Thrameos Nov 28, 2024
a0b2b3e
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 28, 2024
94f21a1
Remove the need for late load... Everyone is equal!
Thrameos Nov 28, 2024
86c7878
Jar support for jpype.class.path
Thrameos Nov 28, 2024
a7197fb
Cleanup
Thrameos Nov 28, 2024
c8ed839
Working on debugging dbapi2 and forName
Thrameos Nov 28, 2024
d5c18dc
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 28, 2024
4e63379
Still working on Database services
Thrameos Nov 28, 2024
4344295
Rework to use reflector class
Thrameos Nov 28, 2024
3cefadd
Why must we specify stuff on our private methods?
Thrameos Nov 28, 2024
3703760
Shut up mypy
Thrameos Nov 28, 2024
ff12201
Update build process to include reflector
Thrameos Nov 28, 2024
4f1eb89
Revised some tests which don't run properly in non-ascii root
Thrameos Nov 28, 2024
7ae5ce8
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 28, 2024
fb94b98
Remove agent option for now
Thrameos Nov 28, 2024
9223000
Works on nonascii path
Thrameos Nov 29, 2024
81f5687
Start clean up
Thrameos Nov 29, 2024
b657fbe
Cleanup
Thrameos Nov 29, 2024
3844c8c
Whitespace
Thrameos Nov 29, 2024
25a2408
Jdk 1.8 build failed. Try again
Thrameos Nov 29, 2024
3942798
Another fix for (broken) Windows
Thrameos Nov 29, 2024
9b15bd8
Fix setupext for JDK 8
Thrameos Nov 29, 2024
3a5d118
Cleanup pass
Thrameos Nov 29, 2024
f38b427
Cleanup and test
Thrameos Nov 29, 2024
b54514c
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 29, 2024
3764749
Try again for delete.
Thrameos Nov 29, 2024
67f732d
Fix broken test
Thrameos Nov 29, 2024
e95010f
Cleanup and doc
Thrameos Nov 30, 2024
800ce78
Merge remote-tracking branch 'refs/remotes/origin/no_agent' into no_a…
Thrameos Nov 30, 2024
fad418d
Work on module support
Thrameos Dec 2, 2024
b932bad
Removing bean access as it requires java.management which is an extra…
Thrameos Dec 2, 2024
773ec40
Working on loading into module
Thrameos Dec 2, 2024
13107ae
Work on clean up and build
Thrameos Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions jpype/_core.py
Original file line number Diff line number Diff line change
@@ -256,15 +256,15 @@
# Not specified at all, use the default classpath.
classpath = _classpath.getClassPath()

# Code for 1.6 release when we add module support
# # Modulepath handling
# old_modulepath = _getOption(jvmargs, "--module-path", _classpath._SEP)
# if old_modulepath:
# # Old style, specified in the arguments
# if modulepath is not None:
# # Cannot apply both styles, conflict
# raise TypeError('modulepath specified twice')
# modulepath = old_modulepath

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
# if modulepath is not None:
# mp = _classpath._SEP.join(_expandClassPath(modulepath))
# extra_jvm_args += ['--module-path=%s'%mp ]
@@ -289,19 +289,23 @@
elif system_class_loader:
# https://bugs.openjdk.org/browse/JDK-8079633?jql=text%20~%20%22ParseUtil%22
raise ValueError("system classloader cannot be specified with non ascii characters in the classpath")
elif support_lib.isascii():
else:
if not support_lib.isascii():
import tempfile
import shutil
tmp = tempfile.gettempdir()
if not tmp.isascii():
raise ValueError("Unable to create ascii temp directory. Clear TEMPDIR, TEMP, and TMP environment variables")
support_lib2 = os.path.join(tmp, "org.jpype.jar")
shutil.copyfile(support_lib, support_lib2)
support_lib = support_lib2

# ok, setup the jpype system classloader and add to the path after startup
# this guarentees all classes have the same permissions as they did in the past
extra_jvm_args += [
'-Djava.system.class.loader=org.jpype.classloader.DynamicClassLoader',
'-Djava.class.path=%s'%support_lib
]
else:
# We are screwed no matter what we try or do.
# Unfortunately the jdk maintainers don't seem to care either.
# This bug is almost 10 years old and spans 16 jdk versions and counting.
# https://bugs.openjdk.org/browse/JDK-8079633?jql=text%20~%20%22ParseUtil%22
raise ValueError("jpype jar must be ascii to add to the system class path")

if agent:
extra_jvm_args += ['-javaagent:' + support_lib]
@@ -347,8 +351,9 @@
if late_load and classpath:
# now we can add to the system classpath
cl = _jpype.JClass("java.lang.ClassLoader").getSystemClassLoader()
from pathlib import Path
for cp in _expandClassPath(classpath):
cl.addFile(_jpype._java_lang_String(cp))
cl.addFile(Path(cp))


def initializeResources():