After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 534650 - jhbuild crashes with "LookupError: unknown encoding:"
jhbuild crashes with "LookupError: unknown encoding:"
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal critical
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2008-05-24 16:37 UTC by Philip Hölzenspies
Modified: 2008-06-04 08:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
workaround buggy getpreferredencoding on darwin (1.14 KB, patch)
2008-05-24 17:43 UTC, Frederic Peters
none Details | Review

Description Philip Hölzenspies 2008-05-24 16:37:06 UTC
Steps to reproduce:
1. jhbuild bootstrap [ on Leopard machine ]
2. 
3. 


Stack trace:
Prefix: /Users/holzensp/gtk/inst
Traceback (most recent call last):
  • File "/Users/holzensp/bin/jhbuild", line 6 in jhbuild.main.main(sys.argv[1:])
  • File "/Users/holzensp/Source/jhbuild/jhbuild/main.py", line 113 in main
    rc = jhbuild.commands.run(command, config, args)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/commands/__init__.py", line 78 in run
    return cmd.execute(config, args)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/commands/__init__.py", line 44 in execute
    return self.run(config, options, args)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/commands/bootstrap.py", line 38 in run
    return cmd_build.run(self, config, options, args)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/commands/base.py", line 228 in run
    return build.build()
  • File "/Users/holzensp/Source/jhbuild/jhbuild/frontends/buildscript.py", line 102 in build
    nextstate, error, altstates = module.run_state(self, state)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/modtypes/__init__.py", line 178 in run_state
    method(buildscript)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/modtypes/autotools.py", line 89 in do_checkout
    self.checkout(buildscript)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/modtypes/__init__.py", line 213 in checkout
    buildscript.set_action(_('Checking out'), self)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/frontends/terminal.py", line 108 in set_action
    self.message('%s %s' % (action, action_target), module_num)
  • File "/Users/holzensp/Source/jhbuild/jhbuild/frontends/terminal.py", line 92 in message
    uprint('%s*** %s ***%s%s' % (t_bold, msg, progress, t_reset))
  • File "/Users/holzensp/Source/jhbuild/jhbuild/main.py", line 48 in uprint
    print s.encode(_encoding, 'replace')
LookupError: unknown encoding:

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?
Comment 1 Frederic Peters 2008-05-24 16:38:49 UTC
Could you paste the output of this command?
  python -c 'import locale; print locale.getpreferredencoding()'
Comment 2 Philip Hölzenspies 2008-05-24 17:29:15 UTC
(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.
Comment 3 Frederic Peters 2008-05-24 17:43:03 UTC
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?
Comment 4 Philip Hölzenspies 2008-05-24 18:03:10 UTC
(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.
Comment 5 Frederic Peters 2008-05-24 18:15:40 UTC
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)
Comment 6 Richard Hult 2008-06-04 07:07:46 UTC
There are a couple of more occurances of this, in frontends/terminal.py for example.


Comment 7 Frederic Peters 2008-06-04 07:24:21 UTC
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.
Comment 8 Richard Hult 2008-06-04 08:09:03 UTC
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()

Comment 9 Frederic Peters 2008-06-04 08:15:01 UTC
I checked those and they are not related (they have appropriate fallbacks).
Comment 10 Richard Hult 2008-06-04 08:34:58 UTC
Oh, sorry! Thanks :)