You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/10 22:44:36 UTC

[allura] 05/41: Misc: small trac import unicode fix; unlikely to be completely functional yet

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8349
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 8fc58ab7367a7fbef21904d1b8a719449104a88f
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Feb 10 12:07:17 2020 -0500

    Misc: small trac import unicode fix; unlikely to be completely functional yet
---
 Allura/allura/scripts/trac_export.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/scripts/trac_export.py b/Allura/allura/scripts/trac_export.py
index d05b68b..19ec460 100644
--- a/Allura/allura/scripts/trac_export.py
+++ b/Allura/allura/scripts/trac_export.py
@@ -255,7 +255,7 @@ class TracExport(object):
         except urllib2.HTTPError, e:
             if 'emulated' in e.msg:
                 body = e.fp.read()
-                if 'beyond the number of pages in the query' in body or 'Log in with a SourceForge account' in body:
+                if 'beyond the number of pages in the query' in six.ensure_text(body):
                     raise StopIteration
             raise
         reader = csv.reader(f)
@@ -263,8 +263,8 @@ class TracExport(object):
         for r in reader:
             if r and r[0].isdigit():
                 id = int(r[0])
-                extra = {'date': self.trac2z_date(
-                    r[1]), 'date_updated': self.trac2z_date(r[2])}
+                extra = {'date': self.trac2z_date(r[1]),
+                         'date_updated': self.trac2z_date(r[2])}
                 res.append((id, extra))
         self.page += 1