Index: captcha.py =================================================================== --- captcha.py (revision 75804) +++ captcha.py (working copy) @@ -130,10 +130,10 @@ word = word1+word2 if verbose: print "word is %s" % word - if nonalpha.search(word): - if verbose: - print "skipping word pair '%s' because it contains non-alphabetic characters" % word - return None + #if nonalpha.search(word): + # if verbose: + # print "skipping word pair '%s' because it contains non-alphabetic characters" % word + # return None for naughty in blacklist: if naughty in word: @@ -150,7 +150,7 @@ sys.exit("Unable to find valid word combinations") def read_wordlist(filename): - return [x.strip().lower() for x in open(wordlist).readlines()] + return [(unicode(x.strip(), "UTF-8")).lower() for x in open(wordlist).readlines()] if __name__ == '__main__': """This grabs random words from the dictionary 'words' (one @@ -215,7 +215,7 @@ word = pick_word(words, blacklist, verbose) salt = "%08x" % random.randrange(2**32) # 64 bits of hash is plenty for this purpose - md5hash = hashlib.md5(key+salt+word+key+salt).hexdigest()[:16] + md5hash = hashlib.md5(key+salt+word.encode("UTF-8")+key+salt).hexdigest()[:16] filename = "image_%s_%s.png" % (salt, md5hash) if dirs: subdir = gen_subdir(output, md5hash, dirs)