From e68ec1d6e509a7ed9fd733ef648c6efec9159d85 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 3 Oct 2011 20:57:51 +0200 Subject: [PATCH] fix unicode issues --- weboob/applications/webcontentedit/webcontentedit.py | 4 ++-- weboob/backends/redmine/browser.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/weboob/applications/webcontentedit/webcontentedit.py b/weboob/applications/webcontentedit/webcontentedit.py index ccd1aa6a..fa8d6318 100644 --- a/weboob/applications/webcontentedit/webcontentedit.py +++ b/weboob/applications/webcontentedit/webcontentedit.py @@ -71,7 +71,7 @@ class WebContentEdit(ReplApplication): content.content = u'' data = '' f.write(data) - paths[path] = content + paths[path.encode('utf-8')] = content params = '' editor = os.environ.get('EDITOR', 'vim') @@ -105,7 +105,7 @@ class WebContentEdit(ReplApplication): errors = CallErrors([]) for content in contents: path = [path for path, c in paths.iteritems() if c == content][0] - sys.stdout.write('Pushing %s...' % content.id) + sys.stdout.write('Pushing %s...' % content.id.encode('utf-8')) sys.stdout.flush() try: self.do('push_content', content, message, minor=minor, backends=[content.backend]).wait() diff --git a/weboob/backends/redmine/browser.py b/weboob/backends/redmine/browser.py index 8dbee317..e526b0b3 100644 --- a/weboob/backends/redmine/browser.py +++ b/weboob/backends/redmine/browser.py @@ -87,19 +87,19 @@ class RedmineBrowser(BaseBrowser): return self._userid def get_wiki_source(self, project, page): - self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, page)) + self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8')))) return self.page.get_source() def set_wiki_source(self, project, page, data, message): - self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, page)) + self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8')))) self.page.set_source(data, message) def get_wiki_preview(self, project, page, data): if (not self.is_on_page(WikiEditPage) or self.page.groups[0] != project or self.page.groups[1] != page): self.location('%s/projects/%s/wiki/%s/edit' % (self.BASEPATH, - project, page)) - url = '%s/projects/%s/wiki/%s/preview' % (self.BASEPATH, project, page) + project, urllib.quote(page.encode('utf-8')))) + url = '%s/projects/%s/wiki/%s/preview' % (self.BASEPATH, project, urllib.quote(page.encode('utf-8'))) params = {} params['content[text]'] = data.encode('utf-8') params['authenticity_token'] = "%s" % self.page.get_authenticity_token()