'local' object has no attribute 'bindtextdomain' on FreeBSD using Python 2.6.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LottaNZB |
Fix Released
|
Medium
|
Severin H |
Bug Description
Hi, I maintain the lottanzb port on FreeBSD and am trying to update it from 0.4.1 to 0.5.1. When trying to run it I get the following error:
Traceback (most recent call last):
File "/usr/local/
app = App()
File "/usr/local/
mcs.__instance = GObjectMeta.
File "/usr/local/
self.
File "/usr/local/
module.
AttributeError: 'module' object has no attribute 'bindtextdomain'
This is with python 2.6.2. The "module" in question I believe is locale and if I remove it from the list in setup_translation it *seems* to work ok. Any ideas?
Cheers,
Zach
Changed in lottanzb: | |
status: | Triaged → Fix Committed |
assignee: | LottaNZB Development Team (lottanzb) → Severin Heiniger (lantash) |
Changed in lottanzb: | |
status: | Fix Committed → Fix Released |
Hi Zach,
thanks for taking the time to report this. I'm not sure why the "locale" module doesn't have a "bindtextdomain" function on your machine. A quick test revealed that for the UI translation to work 100%, one needs to call the three functions provided by both gettext and locale, otherwise, some menu entries will remain untranslated, which is not that bad. At least it's much better than an application crash. ;-)
I could change the setup_translation method to something like this:
domain = "lottanzb"
for module in (gettext, locale):
module. bindtextdomain( domain, resources. get_locale( ))
module. bind_textdomain _codeset( domain, "UTF-8")
module. textdomain( domain)
pass
try:
except AttributeError:
A fix for this bug will be part of LottaNZB 0.5.2.