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

import jnius on Centos7/python 3.4: AttributeError: 'str' object has no attribute 'decode' #218

Closed
rhoerbe opened this issue Apr 14, 2016 · 0 comments
Assignees
Labels

Comments

@rhoerbe
Copy link

rhoerbe commented Apr 14, 2016

import jnius
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/PVZDpolman/dependent_pkg/kivy/pyjnius/jnius/__init__.py", line 13, in <module>
    from .reflect import *
  File "/opt/PVZDpolman/dependent_pkg/kivy/pyjnius/jnius/reflect.py", line 14, in <module>
    class Class(with_metaclass(MetaJavaClass, JavaClass)):
  File "/usr/lib/python3.4/site-packages/six.py", line 808, in __new__
    return meta(name, bases, d)
  File "jnius/jnius_export_class.pxi", line 43, in jnius.MetaJavaClass.__new__ (jnius/jnius.c:17181)
    meta.resolve_class(classDict)
  File "jnius/jnius_export_class.pxi", line 65, in jnius.MetaJavaClass.resolve_class (jnius/jnius.c:17568)
    cdef JNIEnv *j_env = get_jnienv()
  File "jnius/jnius_env.pxi", line 11, in jnius.get_jnienv (jnius/jnius.c:3474)
    default_env = get_platform_jnienv()
  File "jnius/jnius_jvm_dlopen.pxi", line 86, in jnius.get_platform_jnienv (jnius/jnius.c:3405)
    create_jnienv()
  File "jnius/jnius_jvm_dlopen.pxi", line 49, in jnius.create_jnienv (jnius/jnius.c:2864)
    lib_path = str_for_c(os.path.join(JAVA_HOME, JNIUS_LIB_SUFFIX.decode("utf-8")))
AttributeError: 'str' object has no attribute 'decode'

To reproduce this either build the docker file in https://github.com/rhoerbe/docker-test-jnius-centos.git, or on a system with docker installed just run:

docker run -it rhoerbe/docker-test-jnius-centos7 bash
@tito tito self-assigned this Apr 18, 2016
@tito tito added the bug label Apr 18, 2016
@tito tito closed this as completed in ddcaa43 Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants