I have lambda function that works in Python3.6. I tried to update to 3.8 and I am getting below exception when running with pyjks library
def _load_keystores(data, passCode):
logger.info('Load the keystore information')
return jks.KeyStore.loads(data, passCode)
Exception
[ERROR] TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/var/task/service_setup.py", line 40, in lambda_handler
create_keystore(event, secrets_data, config_data,
keystore_prefix='secretKey')
File "/var/task/keystore_compute.py", line 44, in _load_keystores
return jks.KeyStore.loads(data, passCode)
File "/var/task/jks/jks.py", line 484, in loads
magic_number = data[:4]
KeyStore.loads()accepts a byte string as adataparameter, but your error indicates thatNonewas passed instead. Check thetype(data)and verify that it'sbytesbefore passing it toKeyStore.loads().It's impossible to say from your example code where
datais coming from, and how the version upgrade could affect it, but you are gettingNoneinstead of the byte string in it.