From 6294c0b1b3fb14f84de65f788471c3e4822f4813 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Tue, 21 Jul 2009 17:46:37 +0000 Subject: [PATCH] Fix of issue 3111, string.lowercase on Windows. svn: r12831 --- src/ReportBase/_Bibliography.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ReportBase/_Bibliography.py b/src/ReportBase/_Bibliography.py index 058f8ce3f..f1b5b64cb 100644 --- a/src/ReportBase/_Bibliography.py +++ b/src/ReportBase/_Bibliography.py @@ -74,14 +74,14 @@ class Citation(object): @return: The key of the added reference among all the references. @rtype: char """ - letter_count = len(string.lowercase) + letter_count = len(string.ascii_lowercase) ref_count = len(self.__ref_list) x_ref_count = ref_count # Return "a" for ref_count = 0, otherwise log(0) does not work if ref_count == 0: self.__ref_list.append(("a", source_ref)) return "a" - last_letter = string.lowercase[ ref_count % letter_count ] + last_letter = string.ascii_lowercase[ ref_count % letter_count ] key = "" # Calculate prek number of digits. number_of_letters = int(math.log(float(ref_count),float(letter_count)))+1 @@ -94,7 +94,7 @@ class Citation(object): x_ref_count = x_ref_count - pow(letter_count, n) for letter in range(1, number_of_letters): index = x_ref_count / pow(letter_count, letter) % letter_count - key += string.lowercase[ index ] + key += string.ascii_lowercase[ index ] key = key + last_letter self.__ref_list.append((key, source_ref)) return key