You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calls to all appdirs functions that retrieve directory paths fail on Jython in Windows.
Some environments Jython runs in may have JNA. In those environments appdirs is successful. In most standard Java installs, this isn't the case, since JNA doesn't ship as part of Java.
How to Reproduce
Install Jython
Open the interactive interpreter
'import appdirs'
'appdirs.user_data_dir("anything")'
Output
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\jython2.7.2\Lib\appdirs.py", line 80, in user_data_dir
path = os.path.normpath(_get_win_folder(const))
File "C:\jython2.7.2\Lib\appdirs.py", line 470, in _get_win_folder_from_registry
import _winreg
ImportError: No module named _winreg
Analysis
appdirs attempts to get the Windows folder from ctypes, JNA, and then winreg. However, all 3 are unavailable in a default install of Jython.
Resolutions
Having a final fallback go to os.environ would address this in Jython.
I'll submit a PR with this code in it. (Inspired by #129 ... that PR has conflicts right now, so I'll submit a fresh one.)
Description
Calls to all appdirs functions that retrieve directory paths fail on Jython in Windows.
Some environments Jython runs in may have JNA. In those environments appdirs is successful. In most standard Java installs, this isn't the case, since JNA doesn't ship as part of Java.
How to Reproduce
Output
Analysis
appdirs attempts to get the Windows folder from ctypes, JNA, and then winreg. However, all 3 are unavailable in a default install of Jython.
Resolutions
Having a final fallback go to os.environ would address this in Jython.
I'll submit a PR with this code in it. (Inspired by #129 ... that PR has conflicts right now, so I'll submit a fresh one.)
Downstream Issues This Resolves
pip: pypa/pip#8806
The text was updated successfully, but these errors were encountered: