Patch for #31967. Changed pseudo-random generator to random.SystemRandom.choice()

From fc8b3c59d23b2cc637e4db5cd8385720027f59e0 Mon Sep 17 00:00:00 2001 From: agix columbeff@gmail.com Date: Thu, 20 Feb 2020 01:24:24 +0100 Subject: [PATCH] Fix for #31967 (moved). Changed pseudo-random generator to random.SystemRandom.choice()


bridgedb/captcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bridgedb/captcha.py b/bridgedb/captcha.py index b66972c..485974b 100644 --- a/bridgedb/captcha.py +++ b/bridgedb/captcha.py @@ -386,7 +386,7 @@ class GimpCaptcha(Captcha): and a challenge string (used for checking the client's solution). """ try:

  •        imageFilename = random.choice(os.listdir(self.cacheDir))
  •        imageFilename = random.SystemRandom().choice(os.listdir(self.cacheDir))
           imagePath = os.path.join(self.cacheDir, imageFilename)
           with open(imagePath) as imageFile:
               self.image = imageFile.read()

-- 2.17.1