i'm having the same problem with Z/OS for my case i do have a licence file db2jcc_licence_cu.jar and db2jcc_licence_cisuz.jar and a driver db2jcc.jar.
using those files i can connect with sqldevelopper but not the python code.
Reasons:
Blacklisted phrase (1): i'm having the same problem