[Buildbot-commits] [Buildbot] #2145: UnicodeDecodeError on buildslave in runprocess.py

Buildbot nobody at buildbot.net
Sun Nov 13 07:12:32 UTC 2011


#2145: UnicodeDecodeError on buildslave in runprocess.py
--------------------------------+------------------------
Reporter:  mitchellh            |       Owner:
    Type:  defect               |      Status:  new
Priority:  blocker              |   Milestone:  undecided
 Version:  0.8.5                |  Resolution:
Keywords:  unicode, bug, slave  |
--------------------------------+------------------------

Comment (by mitchellh):

 Alright, digging deeper into this I've found the problem, though I'm not
 sure what the proper solution is. The issue is that the `command` getting
 sent to `RunProcess` on the slave is a `unicode` type. Now, this section
 of `RunProcess` properly turns this unicode type into a str type for the
 platform:
 https://github.com/buildbot/buildbot/blob/master/slave/buildslave/runprocess.py#L255-272

 However, `self.fake_command` is not properly encoded, and remains unicode.
 `self.fake_command` is then later used as the log message in the headers:
 https://github.com/buildbot/buildbot/blob/master/slave/buildslave/runprocess.py#L438

 This causes that one log entry to be unicode. So finally, when the log
 messages are attempted to be joined, a `UnicodeDecodeError` is raised
 since it is trying to join many `unicode` and `str` items:
 https://github.com/buildbot/buildbot/blob/master/slave/buildslave/runprocess.py#L542

 My solution, which may not be correct since I'm unsure of the codebase,
 was to to simply change the `fake_command` assignment to the following:

 {{{
 self.fake_command = self.command
 }}}

 This causes it to pick up the proper encoding and work. However, I'm not
 convinced this is the correct solution and I'm sure with the above
 information a proper fix can be deployed.

 Please fix this!

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2145#comment:1>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list