[Buildbot-devel] Exception when performing full SVN update on windows slave

Dustin J. Mitchell dustin at v.igoro.us
Tue Dec 13 00:55:14 UTC 2011


On Mon, Dec 12, 2011 at 2:36 PM, Jean-Marc Dressler
<buildbot at jmd.fastmail.fm> wrote:
> Concerning the e.strerror it probably uses the 'mbcs' encoding. The
> Python Programming FAQ entry on UnicodeError also suggests this is the
> encoding to use in most cases on Windows. I have checked that the 'mbcs'
> encoding works for my case (where strerror is 'Nom de r\xe9pertoire non
> valide').

Indeed, from http://docs.python.org/howto/unicode.html:

  on Windows, Python uses the name “mbcs” to refer to whatever the
currently configured encoding is.

So that would be the encoding to use.

--- a/slave/buildslave/commands/utils.py
+++ b/slave/buildslave/commands/utils.py
@@ -68,7 +68,9 @@ if runtime.platformType  == 'win32':
         try:
             list = os.listdir(dir)
         except WindowsError, e:
-            log.msg("rmdirRecursive: unable to listdir %s (%s).
Trying to remove like a dir" % (dir, e.strerror))
+            msg = ("rmdirRecursive: unable to listdir %s (%s). Trying to "
+                   "remove like a dir" % (dir, e.strerror.decode('mbcs')))
+            log.msg(msg.encode('utf-8'))
             os.rmdir(dir)
             return

This fix is in https://github.com/buildbot/buildbot/commit/d8128a478a6b05fcc52712bd59aff7a0ccb925cd
- can you give it a try?

Dustin




More information about the devel mailing list