GNOME Bugzilla – Bug 534650
jhbuild crashes with "LookupError: unknown encoding:"
Last modified: 2008-06-04 08:34:58 UTC
Steps to reproduce: 1. jhbuild bootstrap [ on Leopard machine ] 2. 3. Stack trace: Prefix: /Users/holzensp/gtk/inst Traceback (most recent call last):
+ Trace 198541
rc = jhbuild.commands.run(command, config, args)
return cmd.execute(config, args)
return self.run(config, options, args)
return cmd_build.run(self, config, options, args)
return build.build()
nextstate, error, altstates = module.run_state(self, state)
method(buildscript)
self.checkout(buildscript)
buildscript.set_action(_('Checking out'), self)
self.message('%s %s' % (action, action_target), module_num)
uprint('%s*** %s ***%s%s' % (t_bold, msg, progress, t_reset))
print s.encode(_encoding, 'replace')
Other information: I must have missed something, but I'm running into a python error that confuses me. I'm guessing it has something to do with locale settings I have on my Leopard machine, but I just don't know which one. Looking at this report, can anybody tell me what's wrong?
Could you paste the output of this command? python -c 'import locale; print locale.getpreferredencoding()'
(In reply to comment #1) > Could you paste the output of this command? > python -c 'import locale; print locale.getpreferredencoding()' That command just gives me an empty line, i.e.: ~$ python -c 'import locale; print locale.getpreferredencoding()' ~$ This seems to explain the empty line after the last colon in the original message.
Created attachment 111469 [details] [review] workaround buggy getpreferredencoding on darwin It looks like a known problem on Mac OS X; could you check this patch fixes the issue?
(In reply to comment #3) > Created an attachment (id=111469) [edit] > workaround buggy getpreferredencoding on darwin > > It looks like a known problem on Mac OS X; could you check this patch fixes the > issue? That seems to have done it. Sorry for not searching more thoroughly. It feels now as if I should have come across this patch earlier. Thank you very much, though.
Note you shouldn't mark bug as fixed when the patch has not been commited yet (just did it now after you confirmed it as working). 2008-05-24 Frederic Peters <fpeters@0d.be> * jhbuild/main.py: work around locale.getpreferredencoding() returning an empty string in Mac OS X. (closes: #534650)
There are a couple of more occurances of this, in frontends/terminal.py for example.
Could you point them? I see a single occurence of locale.getpreferredencoding() in terminal.py, and I just removed it. 2008-06-04 Frederic Peters <fpeters@0d.be> * jhbuild/frontends/terminal.py: removed occurence of locale. getpreferredencoding() that fails on Mac OS X. * jhbuild/main.py: added convenience uencode() function.
Thanks, that was quick :) I see one in autobuild.py and tinderbox.py: grep preferr *py autobuild.py: charset = locale.getpreferredencoding() tinderbox.py: charset = locale.getpreferredencoding()
I checked those and they are not related (they have appropriate fallbacks).
Oh, sorry! Thanks :)