[
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17492229#comment-17492229
]
Andi Vajda commented on PYLUCENE-62:
------------------------------------
I took a look at your patch and attached a version that should be less
intrusive and work, hopefully, too:
- you do not need to add windows.py to modules, it is already included and
installed
- you do need to keep code conditional to windows, you can't assume people
are not
going to carry code around between machines
- in windows.py, I renamed get_jvm_dll_directory() to
get_jvm_dll_directory_from_registry()
and otherwise kept it unchanged
- in windows.py, I added get_jvm_dll_directory_from_env() based on your code.
- in windows.py, I also changed add_jvm_dll_directory_to_path() to do the
right thing, like
you did
- I changed the --find-jvm-dll command line flag from a boolean to a string
that must be one
of "client" or "server" and made it default to "client" for python >= 3.8,
None otherwise.
Please, try the attached patch out by passing it --find-jvm-dll client (or
server), I have no access to Windows, so I could not try it out myself. I
verified that it didn't break on Mac.
Thank you !
> Not finding jvm.dll on windows
> ------------------------------
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
> Issue Type: Bug
> Reporter: Petrus Hyvönen
> Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the
> os.add_dll_directory() function.
>
> Apparently something changed in Python 3.8 regarding this, "Python 3.8
> changed the DLL resolution order
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew]"
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>
> Proposed fix in a patch below. It can likely be rewritten in some more neat
> way. :)
--
This message was sent by Atlassian Jira
(v8.20.1#820001)