[PATCH] Manually encode utf-8 patch in testcase
Dirk Wallenstein
halsmit at t-online.de
Fri Feb 11 20:41:54 EST 2011
On Fri, Feb 11, 2011 at 07:57:26AM +0800, Jeremy Kerr wrote:
> Dirk,
>
> > Otherwise there will be a UnicodeDecodeError.
>
> Where are you getting this UnicodeDecodeError? With 7fd7d0bbe reverted, I see
> all the testcases pass.
Hm, maybe this is a Python bug (Python-2.6.5). Seemed a bit strange
anyway as the doc explicitly allows to pass in unicode. I get a couple
of these (all errors attached):
======================================================================
ERROR: testCommentContent (patchwork.tests.patchparser.UTF8InlinePatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/patchwork/apps/patchwork/tests/patchparser.py", line 85, in setUp
(self.patch, self.comment) = find_content(self.project, email)
File "/srv/patchwork/apps/patchwork/bin/parsemail.py", line 166, in find_content
payload = unicode(payload, charset)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 146-148: invalid data
======================================================================
--
Greetings,
Dirk
-------------- next part --------------
======================================================================
ERROR: testCommentContent (patchwork.tests.patchparser.UTF8InlinePatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/patchwork/apps/patchwork/tests/patchparser.py", line 85, in setUp
(self.patch, self.comment) = find_content(self.project, email)
File "/srv/patchwork/apps/patchwork/bin/parsemail.py", line 166, in find_content
payload = unicode(payload, charset)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 146-148: invalid data
======================================================================
ERROR: testCommentPresence (patchwork.tests.patchparser.UTF8InlinePatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/patchwork/apps/patchwork/tests/patchparser.py", line 85, in setUp
(self.patch, self.comment) = find_content(self.project, email)
File "/srv/patchwork/apps/patchwork/bin/parsemail.py", line 166, in find_content
payload = unicode(payload, charset)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 146-148: invalid data
======================================================================
ERROR: testPatchContent (patchwork.tests.patchparser.UTF8InlinePatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/patchwork/apps/patchwork/tests/patchparser.py", line 85, in setUp
(self.patch, self.comment) = find_content(self.project, email)
File "/srv/patchwork/apps/patchwork/bin/parsemail.py", line 166, in find_content
payload = unicode(payload, charset)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 146-148: invalid data
======================================================================
ERROR: testPatchPresence (patchwork.tests.patchparser.UTF8InlinePatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/patchwork/apps/patchwork/tests/patchparser.py", line 85, in setUp
(self.patch, self.comment) = find_content(self.project, email)
File "/srv/patchwork/apps/patchwork/bin/parsemail.py", line 166, in find_content
payload = unicode(payload, charset)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 146-148: invalid data
More information about the Patchwork
mailing list