Ticket #951 (closed defect: fixed)
UTF-8 data in logs causes web rss feed exception
| Reported by: | AHowell | Owned by: | AHowell |
|---|---|---|---|
| Priority: | major | Milestone: | 0.8.2 |
| Version: | 0.8.1 | Keywords: | web |
| Cc: |
Description
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/twisted/protocols/basic.py", line 251, in dataReceived
why = self.lineReceived(line)
File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 1573, in lineReceived
self.allContentReceived()
File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 1641, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 807, in requestReceived
self.process()
--- <exception caught here> ---
File "/usr/lib/python2.7/site-packages/twisted/web/server.py", line 125, in process
self.render(resrc)
File "/usr/lib/python2.7/site-packages/twisted/web/server.py", line 132, in render
body = resrc.render(self)
File "/usr/lib/python2.7/site-packages/buildbot/status/web/feeds.py", line 40, in render
data = self.content(request)
File "/usr/lib/python2.7/site-packages/buildbot/status/web/feeds.py", line 202, in content
log_lines.extend(unicode(logdata.split('
')[-30:],'utf-8'))
exceptions.TypeError?: coercing to Unicode: need string or buffer, list found
Change History
comment:2 Changed 3 years ago by dustin
- Keywords web added
- Status changed from closed to reopened
- Resolution fixed deleted
- Milestone changed from undecided to 0.8.2
Not fixed yet :)
comment:3 Changed 3 years ago by AndyHowell
- Status changed from reopened to closed
- Resolution set to fixed
Fixes #951. Web rss feed is choking on UTF-8 log data
Changeset: 5cbdcd768dc9e2297181b301e11ddae5f767e4a2
comment:4 Changed 3 years ago by Dustin J. Mitchell
Merge branch 'cvsmailsource' of git://github.com/AndyHowell/buildbot
Fixes #959
- 'cvsmailsource' of git://github.com/AndyHowell/buildbot: option.smtplib was not getting when running live Added depreciation notes to news and manual Added more test to test_changes_mail_CVSMaildirSource.py and test_contrib_buildbot_cvs_mail.py Fixed mail.py problems brought out by tests use optparse for buildbot_cvs_mail; fix its tests rename to CVSMaildirSource fix relative path handling in buildbot_cvs_mail tests docs tweaks for cvs support buildbot/changes/mail.py buildbot/test/unit/test_changes_mail_MaildirSource.py removed fileTupleList as it was not being used master/buildbot/changes/mail.py master/contrib/buildbot_cvs_mail.py Replaced tabs with spaces master/buildbot/changes/mail.py added BuildbotCVSMaildir source master/buildbot/test/unit/test_changes_mail_MaildirSource.py test for BuildbotCVSMaildir in mail.py master/buildbot/test/unit/test_contrib_buildbot_cvs_mail.py test for buildbot_cvs_mail.py master/contrib/buildbot_cvs_mail.py send mail to buildbot on CVS checkins master/docs/cfg-changesources.texinfo updated docs Fixes #951. Web rss feed is choking on UTF-8 log data Changeset: b9feff0338ecd7cceead5ede70852abc1f0a6d2a
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
This fixes it. Is there a better way to create unicode transformed data. My python abilities are limited...
--- a/master/buildbot/status/web/feeds.py +++ b/master/buildbot/status/web/feeds.py @@ -198,8 +198,10 @@ class FeedResource?(XmlResource?):
-
')[-30:]) + unilist = list() + for line in logdata.split(' ')[-30:]: + unilist.append(unicode(line,'utf-8')) + log_lines.extend(unilist)