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

When the apk is turned on it gives me an error in the hashlib python3.6 #1260

Closed
AntoniRomera opened this issue Apr 17, 2018 · 7 comments
Closed

Comments

@AntoniRomera
Copy link

AntoniRomera commented Apr 17, 2018

I created the apk with buildozer and when I turn it on my device it gives me a hashlib error that does not recognize the hash type...

I use python3.6, with python_crystax
In ubuntu 16.04

I/python ( 3589): ERROR:root:code for hash blake2b was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type blake2b I/python ( 3589): ERROR:root:code for hash blake2s was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type blake2s I/python ( 3589): ERROR:root:code for hash sha3_224 was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type sha3_224 I/python ( 3589): ERROR:root:code for hash sha3_256 was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type sha3_256 I/python ( 3589): ERROR:root:code for hash sha3_384 was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type sha3_384 I/python ( 3589): ERROR:root:code for hash sha3_512 was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type sha3_512 I/python ( 3589): ERROR:root:code for hash shake_128 was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type shake_128 I/python ( 3589): ERROR:root:code for hash shake_256 was not found. I/python ( 3589): Traceback (most recent call last): I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 243, in <module> I/python ( 3589): globals()[__func_name] = __get_hash(__func_name) I/python ( 3589): File "/data/data/org.astro.demo/files/app/crystax_python/stdlib.zip/hashlib.py", line 113, in __get_builtin_constructor I/python ( 3589): raise ValueError('unsupported hash type ' + name) I/python ( 3589): ValueError: unsupported hash type shake_256

@AntoniRomera AntoniRomera changed the title When APK start, hashlib error with python3.6 When the apk is turned on it gives me an error in the hashlib python3.6 Apr 19, 2018
@woodhead28
Copy link

woodhead28 commented May 29, 2018

same here,
I use python3.6, with python_crystax in ubuntu 18.04
Kivy 1.10.1.dev0

@karolyi
Copy link

karolyi commented Jun 3, 2018

+1

@inclement
Copy link
Member

From Homebrew/legacy-homebrew#21329 and Homebrew/legacy-homebrew#22816 talking about macOS builds, I think this arises from openssl not being present. As far as I cant tell it doesn't actually cause any problems in itself. It will be interesting to see if #1217 prevents these errors from occurring.

@agilewalker
Copy link

agilewalker commented Jun 4, 2018

Assuming you're using crystax-ndk-10.3.2, try this out:
Insert following lines into file crystax-ndk-10.3.2/build/tools/build-target-python.sh under line no. 642

#_hashlib
   if [ -n "$OPENSSL_HOME" ]; then
       local BUILDDIR_SSL="$BUILDDIR/ssl"
       local OBJDIR_SSL="$BUILDDIR_SSL/obj/local/$ABI"

       run mkdir -p "$BUILDDIR_SSL/jni"
       fail_panic "Can't create directory: $BUILDDIR_SSL/jni"

       {
           echo 'LOCAL_PATH := $(call my-dir)'
           echo 'include $(CLEAR_VARS)'
           echo 'LOCAL_MODULE := _hashlib'
           echo "MY_PYTHON_SRC_ROOT := $PYTHON_SRCDIR"
           echo 'LOCAL_SRC_FILES := \'
           echo '  $(MY_PYTHON_SRC_ROOT)/Modules/_hashopenssl.c'
           echo 'LOCAL_STATIC_LIBRARIES := python_shared openssl_static opencrypto_static'
           echo 'include $(BUILD_SHARED_LIBRARY)'
           echo "\$(call import-module,python/$PYTHON_ABI)"
           echo "\$(call import-module,$OPENSSL_HOME)"
       } >$BUILDDIR_SSL/jni/Android.mk
       fail_panic "Can't generate $BUILDDIR_SSL/jni/Android.mk"

       run $NDK_DIR/ndk-build -C $BUILDDIR_SSL -j$NUM_JOBS APP_ABI=$ABI V=1
       fail_panic "Can't build python$PYTHON_ABI-$ABI module '_hashlib'"

       log "Install python$PYTHON_ABI-$ABI module '_hashlib' in $PYBIN_INSTALLDIR_MODULES"
       run cp -p -T $OBJDIR_SSL/lib_hashlib.so $PYBIN_INSTALLDIR_MODULES/_hashlib.so
       fail_panic "Can't install python$PYTHON_ABI-$ABI module '_hashlib' in $PYBIN_INSTALLDIR_MODULES"
   fi

@AntoniRomera
Copy link
Author

It's solved by patch openssl

@karolyi
Copy link

karolyi commented Jun 5, 2018

is it released?

@AntoniRomera
Copy link
Author

no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants