Python documentation states that the pseudo-random generator random.Random shouldn't be used for security purposes. Therefore, I switched the currently used random.choice in password generation code to secrets.choice on platforms where it's available, and random.SystemRandom's choice elsewhere. New code passes tox tests.
Coverage increased (+0.09%) to 90.805% when pulling cae2ad7ad283db714f91a5fd9ea8d2a82c3e0b7c on prabi:better_generate into cbd0a048ae04a59c96ec6696c3c32e7b75936c86 on aviau:master.
Python documentation states that the pseudo-random generator random.Random shouldn't be used for security purposes. Therefore, I switched the currently used random.choice in password generation code to secrets.choice on platforms where it's available, and random.SystemRandom's choice elsewhere. New code passes tox tests.