v18 Several errors on hashllib.py
#1
Test build:

KodiSetup-20180127-886d5738-feature_python3-x86 on Windows 10 x86-64

I tried adapting on of my addons and its respective library to support Python 3. I did all the adaptations manually to support python 3 as well but I am getting the following errors:
Code:
09:57:52.742 T:11780 ERROR: ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 119, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
09:57:52.744 T:11780 ERROR: ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 119, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
09:57:52.747 T:11780 ERROR: ERROR:root:code for hash sha3_224 was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_224'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_224
09:57:52.749 T:11780 ERROR: ERROR:root:code for hash sha3_256 was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_256'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_256
09:57:52.751 T:11780 ERROR: ERROR:root:code for hash sha3_384 was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_384'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_384
09:57:52.754 T:11780 ERROR: ERROR:root:code for hash sha3_512 was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_512'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_512
09:57:52.756 T:11780 ERROR: ERROR:root:code for hash shake_128 was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_shake_128'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type shake_128
09:57:52.758 T:11780 ERROR: ERROR:root:code for hash shake_256 was not found.
Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_shake_256'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
return __get_builtin_constructor(name)
File "P:\GitHub\Testers\Leia\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type shake_256
09:57:54.430 T:11780 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: 'str' object has no attribute 'decode'
-->End of Python script error report<--
Reply
#2
Missing hash classes is a known issue of the current Python 3 builds, at least on Windows. It seems that some binary modules from the Python Standard library have not been compiled correctly. But it can be ignored for now, unless you are using those hashes in your addon. The most interesting part is at the very end. It looks like you haven't fixed your strings when converting the addon code.
Reply
#3
I am not using hash classes directly on my addon, I simply done a test and thought about reporting it. As for the last part it looks like I left a piece there with the older decode method. Will fix in due time.
Reply
#4
Thanks you for reporting it. As I said, it's a known issue that usually happens when you are importing requests module. As for strings, yes, it's one of the trickiest parts of the conversion process since Python 2 does not have clear separation between str and unicode type (which from today's perspective was a bad design decision when introducing unicode type in Python 2.0).
Reply
#5
Just wanted to add that I to am getting them... I am not even sure where I am calling the hashlib from.
code:
06:46:18.967 T:9720   ERROR: ERROR:root:code for hash blake2b was not found.
                                            Traceback (most recent call last):
                                              File "E:\Metadata_V18_64PY3\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "E:\Metadata_V18_64PY3\Kodi\system\python\Lib\hashlib.py", line 119, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "E:\Metadata_V18_64PY3\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type blake2b
06:46:18.967 T:9720   DEBUG: .
06:46:18.967 T:9720   ERROR: ERROR:root:code for hash blake2s was not found.
                                            Traceback (most recent call last):
                                              File "E:\Metadata_V18_64PY3\Kodi\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "E:\Metadata_V18_64PY3\Kodi\system\python\Lib\hashlib.py", line 119, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "E:\Metadata_V18_64PY3\Kodi\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type blake2s
06:46:18.968 T:9720   DEBUG: .

its a lot more but it got long and I cant figure out how to make the scroll box
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#6
@smitchell6879 Have you actually read this topic? It's a known issue and reporting it n-th time won't change anything. Please wait until it is fixed.
Reply
#7
@Roman_V_M  Sorry wasn't sure it log may have contained something extra to help toward solving it the issue.  Heck I am not even sure where I am calling it from in my script to even trigger it.
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#8
New windows test builds are available where the hashlib issue is fixed.
Reply
#9
(2018-04-26, 08:42)Rechi Wrote: New windows test builds are available where the hashlib issue is fixed.

Some of built-in binary modules are still missing.
Reply
#10
Do you have a list of the missing modules?
Reply
#11
@Rechi I finally found some time and tried all binary modules that normally come with Python 3.6 for Windows (\DLLs folder). The following are missing and throw ModuleNotFoundError:
none:
_asyncio
_decimal
_lzma
_msi
_overlapped
_testbuffer
_testcapi
_testconsole
_testimportmultiple
_testmultiphase

There are also _tkinter and winsound missing, but those make no sense inside Kodi. The rest are imported normally.
Reply
#12
none:
_testbuffer
_testcapi
_testconsole
_testimportmultiple
_testmultiphase
Aren't those only test modules? I see no reason to run python tests in an addon

none:
_msi
Why would an addon have to create Windows installer or CAB files? AFIK it wasn't included in all Krypton builds.

none:
_asyncio
Can have a look at it. Is it useful for addons?

none:
_decimal
_lzma
_overlapped
Looked at the source code at it looks like those are also not available for android, ios and osx, but can have a look at those too.
Reply
#13
(2018-05-01, 14:37)Rechi Wrote: Can have a look at it. Is it useful for addons?

It's an asynchronous networking library - cool new thing in Python 3. Well, not that new, but in 3.5 they added support on language syntax level with async/await keywords. I'm sure it will find its uses. 
(2018-05-01, 14:37)Rechi Wrote: _decimal
_lzma
_overlapped
I don't know about overlapped, but the first two look useful in some cases. 

Agree about _test* and msi.
Reply

Logout Mark Read Team Forum Stats Members Help
Several errors on hashllib.py0