PDA

View Full Version : python error when starting deluge


lanteau
November 1st, 2006, 06:45 PM
When I try to run deluge I get this nice error:

Traceback (most recent call last):
File "deluge.py", line 774, in ?
fallback=True)
File "/usr/lib/python2.4/gettext.py", line 452, in translation
mofiles = find(domain, localedir, languages, all=1)
File "/usr/lib/python2.4/gettext.py", line 424, in find
for nelang in _expand_lang(lang):
File "/usr/lib/python2.4/gettext.py", line 129, in _expand_lang
locale = normalize(locale)
File "/usr/lib/python2.4/locale.py", line 214, in normalize
fullname = localename.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

I have installed the python-libtorrent.

zachtib
November 1st, 2006, 06:50 PM
When I try to run deluge I get this nice error:

Traceback (most recent call last):
File "deluge.py", line 774, in ?
fallback=True)
File "/usr/lib/python2.4/gettext.py", line 452, in translation
mofiles = find(domain, localedir, languages, all=1)
File "/usr/lib/python2.4/gettext.py", line 424, in find
for nelang in _expand_lang(lang):
File "/usr/lib/python2.4/gettext.py", line 129, in _expand_lang
locale = normalize(locale)
File "/usr/lib/python2.4/locale.py", line 214, in normalize
fullname = localename.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

I have installed the python-libtorrent.


it seems the problem is with the translation... what distro are you running on?

lanteau
November 2nd, 2006, 12:03 AM
I'm running Kanotix, which is based off of Debian Unstable(Sid).

cnu
November 2nd, 2006, 12:12 AM
I too get this error and i am in Dapper 6.06

zachtib
November 2nd, 2006, 12:12 AM
I'm running Kanotix, which is based off of Debian Unstable(Sid).

do you have the gettext libs installed?

andrewresch
November 2nd, 2006, 04:17 AM
I had the same problem and to fix it I had to modify deluge.py around line 764.

if (locality == None):
locality = "en_US"

This was added right below:

import locale ## Here, because we really shouldn't be using
locality = locale.getlocale()[0]

It appears that my system does not have a locale set and locality is set to None. I just have deluge set it to en_US which should be a safe default.

kripkenstein
November 2nd, 2006, 04:38 AM
Anyone who gets this error, and is running from SVN: please update to the latest SVN, and see what happens. I added a minor debug message that should help figure out what is going on here.

You should see, a few lines before the crash dump (which was pasted above), a line starting with "Locality:". Please post here the output, including that line and the crash dump. To save time, please post all lines starting from a few lines before the "Locality", and all the way to the end (including the crash dump). Thanks.

kripkenstein
November 2nd, 2006, 04:41 AM
I had the same problem and to fix it I had to modify deluge.py around line 764.


Nice work, this may be the fix :)

EDIT: ignore my request before, I will commit this fix. Users who had the problem before, please tell me if it indeed fixes the problem (in SVN, of course).

armin76
November 2nd, 2006, 05:12 AM
I had the same problem on Gentoo. Having set LC_ALL to 'C' or 'POSIX', deluge failed to start at the same error. I have to set LC_ALL to 'en_US'.

kripkenstein
November 2nd, 2006, 05:26 AM
I had the same problem on Gentoo. Having set LC_ALL to 'C' or 'POSIX', deluge failed to start at the same error. I have to set LC_ALL to 'en_US'.

If you can, please try the current SVN code, with the fix from an hour ago, and see if that fixes things.

armin76
November 2nd, 2006, 07:08 AM
Yep, it works :)

Thanks!

kripkenstein
November 2nd, 2006, 07:10 AM
Yep, it works :)

Thanks!

Thank andrewresch, he suggested the fix :)

armin76
November 2nd, 2006, 07:30 AM
Thanks andrewresch, then :)

andrewresch
November 2nd, 2006, 03:49 PM
Glad it worked. ;)