Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2047 by m.milbr...@gmail.com: UnicodeDecodeError: 'utf8' codec
can't decode byte
http://code.google.com/p/reviewboard/issues/detail?id=2047
* NOTE: Do not post confidential information in this bug report. *
* If you need immediate support, please contact *
* reviewbo...@googlegroups.com *
What version are you running?
1.5.4.1
What's the URL of the page containing the problem?
https://<server>/api/json/reviewrequests/217417/update_from_changenum/:
What steps will reproduce the problem?
1. On Windows or OSX add a typographical double quote to the Perforce
description of the CLN you are attempting to post ( e.g. on windows Alt +
0147 ).
2. post the review using post-review <CLN>
What is the expected output? What do you see instead?
Expected to post a review, but get error message
User Message
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>500 - Internal Server Error | Review Board</title>
</head>
<body>
<h1>Something broke! (Error 500)</h1>
<p>
It appears something broke when you tried to go to here. This is either
a bug in Review Board or a server configuration error. Please report
this to your administrator.
</p>
</body>
</title>
Server Message:
....
File "/build/toolchain/lin32/python-2.6.1/lib/python2.6/json/encoder.py",
line 294, in _iterencode
yield encoder(o)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x93 in position 0:
unexpected code byte
What operating system are you using? What browser?
Centos 5.5 x86_64
Please provide any additional information below.
From what I can tell by default Windows and OSx will encode these type of
characters as ASCII using one byte. The Django framework will attempt to
decode these using utf-8 but fails because not encoded as expected.
This primarily appears to have when users have these type of characters
within the change description on Perforce.
It appears potentially that scmtool/perforce.py could be patched to replace
these characters within function parse_change_desc ( e.g.
<str>.decode('utf-8', 'replace'). Haven't given it much thought yet in
case there are any side-effects to this but at least the review appears to
be successfully posted.
--
You received this message because you are subscribed to the Google Groups
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/reviewboard-issues?hl=en.