From 12b851a1b8099af40688f909ecb32ad4d1d0bcfd Mon Sep 17 00:00:00 2001 From: urlbot Date: Sun, 30 Aug 2015 10:05:14 +0200 Subject: [PATCH] seed random() with urandom --- common.py | 4 +++- plugins.py | 2 +- urlbot.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common.py b/common.py index 0952f2f..6beaeb3 100644 --- a/common.py +++ b/common.py @@ -5,7 +5,7 @@ if '__main__' == __name__: print('''this is a library file, which is not meant to be executed''') exit(-1) -import sys, time, pickle, os, logging +import sys, time, pickle, os, logging, random from local_config import conf RATE_GLOBAL = 0x01 @@ -29,6 +29,8 @@ logging.basicConfig( log = logging.getLogger() log.plugin = log.info # ... probably fix this sometime (FIXME) +random.seed(os.urandom(8)) + def debug_enabled(): # return True return False diff --git a/plugins.py b/plugins.py index ab80649..5664eb9 100644 --- a/plugins.py +++ b/plugins.py @@ -5,7 +5,7 @@ if '__main__' == __name__: print('''this is a plugin file, which is not meant to be executed''') exit(-1) -import time, random, unicodedata, re, sys, urllib.request, json +import time, unicodedata, re, sys, urllib.request, json import types import traceback import urllib.parse diff --git a/urlbot.py b/urlbot.py index d5e15d6..4b13f0f 100755 --- a/urlbot.py +++ b/urlbot.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -import sys, re, time, pickle, random +import sys, re, time, pickle import urllib.request, urllib.parse, urllib.error, html.parser from common import *