mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix string.letters in non english locales
This commit is contained in:
parent
f71f60ab0c
commit
c11bbe3eea
@ -19,12 +19,15 @@ def generate_test_db(library_path,
|
|||||||
max_tags=10
|
max_tags=10
|
||||||
):
|
):
|
||||||
import random, string, os, sys, time
|
import random, string, os, sys, time
|
||||||
|
from calibre.constants import preferred_encoding
|
||||||
|
|
||||||
if not os.path.exists(library_path):
|
if not os.path.exists(library_path):
|
||||||
os.makedirs(library_path)
|
os.makedirs(library_path)
|
||||||
|
|
||||||
|
letters = string.letters.decode(preferred_encoding)
|
||||||
|
|
||||||
def randstr(length):
|
def randstr(length):
|
||||||
return ''.join(random.choice(string.letters) for i in
|
return ''.join(random.choice(letters) for i in
|
||||||
xrange(length))
|
xrange(length))
|
||||||
|
|
||||||
all_tags = [randstr(tag_length) for j in xrange(num_of_tags)]
|
all_tags = [randstr(tag_length) for j in xrange(num_of_tags)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user