From: Bernie Innocenti Date: Mon, 15 Dec 2008 03:31:48 +0000 (-0500) Subject: UTF-8 fixup for Python 3.0 X-Git-Tag: v4.0~16 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=refs%2Fremotes%2Fsunjammer%2Fpython3;p=geekigeeki.git UTF-8 fixup for Python 3.0 --- 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*)(.*)$")