From 0a6dbfd05009685e2c6eeb861023cf7da82ef60f Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 14 Dec 2008 22:31:48 -0500 Subject: [PATCH] UTF-8 fixup for Python 3.0 --- geekigeeki.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index ca16283..6e1ba6e 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -221,7 +221,7 @@ def handle_fullsearch(needle): print("") @@ -544,7 +544,7 @@ class WikiFormatter: indent_re = re.compile(r"^\s*") tr_re = re.compile(r"^\s*\|\|") eol_re = re.compile(r"\r?\n") - for self.line in eol_re.split(str(self.raw.expandtabs())): + for self.line in eol_re.split(str(self.raw.expandtabs(), 'utf-8')): # Skip pragmas if self.in_header: if self.line.startswith('#'): @@ -584,7 +584,7 @@ class Page: return os.path.join(data_dir, self.page_name) def _tmp_filename(self): - return os.path.join(data_dir, ('#' + self.page_name.replace('/','_') + '.' + repr(os.getpid()) + '#')) + return os.path.join(data_dir, ('#' + self.page_name.replace('/','_') + '.' + str(os.getpid()) + '#')) def exists(self): try: @@ -631,6 +631,7 @@ class Page: def pragmas(self): if not '_pragmas' in self.__dict__: + self._pragmas = {} try: file = open(self._filename(), 'rt') attr_re = re.compile(r"^#(\S*)(.*)$") -- 2.25.1