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

__PYVENV_LAUNCHER__ set to MacPorts python causes TypeError #194

Closed
rhoerbe opened this issue Dec 28, 2015 · 3 comments
Closed

__PYVENV_LAUNCHER__ set to MacPorts python causes TypeError #194

rhoerbe opened this issue Dec 28, 2015 · 3 comments

Comments

@rhoerbe
Copy link

rhoerbe commented Dec 28, 2015

Launching a UnitTest from within PyCharm 5 with a virtualenv causes "TypeError: Can't mix strings and bytes in path components" on executing "from jnius import autoclass". This happens in a path operation joining $JAVA_HOME with jre/lib/server/libjvm.dylib. This is looking like a follow-up error, but hardly traceable in a standard python debug environment.

This behavior occurs with MacPorts python 3.4. I am just documenting this; possibly the error handling could be improved?

Traceback (most recent call last):
  File "/Applications/3rdParty/PyCharm.app/Contents/helpers/pycharm/utrunner.py", line 121, in <module>
    modules = [loadSource(a[0])]
  File "/Applications/3rdParty/PyCharm.app/Contents/helpers/pycharm/utrunner.py", line 41, in loadSource
    module = imp.load_source(moduleName, fileName)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/Users/admin/devl/pycharm/rhoerbe/PVZD/PolicyManager/tests/PMPTestNoSig-test04.py", line 12, in <module>
    import PMP
  File "/Users/admin/devl/pycharm/rhoerbe/PVZD/PolicyManager/src/PMP.py", line 3, in <module>
    from aodsFileHandler import *
  File "/Users/admin/devl/pycharm/rhoerbe/PVZD/PolicyManager/src/aodsFileHandler.py", line 4, in <module>
    from jnius import autoclass
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jnius-1.1.dev0-py3.4-macosx-10.11-x86_64.egg/jnius/__init__.py", line 13, in <module>
    from .reflect import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jnius-1.1.dev0-py3.4-macosx-10.11-x86_64.egg/jnius/reflect.py", line 16, in <module>
    class Class(with_metaclass(MetaJavaClass, JavaClass)):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/future/utils/__init__.py", line 137, in __new__
    return meta(name, bases, d)
  File "jnius/jnius_export_class.pxi", line 43, in jnius.MetaJavaClass.__new__ (jnius/jnius.c:16835)
  File "jnius/jnius_export_class.pxi", line 65, in jnius.MetaJavaClass.resolve_class (jnius/jnius.c:17231)
  File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv (jnius/jnius.c:3316)
  File "jnius/jnius_jvm_dlopen.pxi", line 87, in jnius.get_platform_jnienv (jnius/jnius.c:3244)
  File "jnius/jnius_jvm_dlopen.pxi", line 52, in jnius.create_jnienv (jnius/jnius.c:2728)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/posixpath.py", line 89, in join
    "components") from None

Using benson-basis fork for python3 compat on OSX.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/29443547-__pyvenv_launcher__-set-to-macports-python-causes-typeerror?utm_campaign=plugin&utm_content=tracker%2F77133&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77133&utm_medium=issues&utm_source=github).
@rhoerbe
Copy link
Author

rhoerbe commented Dec 28, 2015

The error message came up in various conditions. Using the scenario above but with python 3.5 resulted in the same message, regardless of the setting of PYVENV_LAUNCHER

@Julian-O
Copy link
Contributor

8 years later, is this still repeatable?

Copy link

github-actions bot commented Dec 9, 2023

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants