Erwan |
Zondag 1 Juni\ 2008 om 17:24
|
Erwan
|
Bonjour,
je viens d'installer le rpm de PlayOnLinux 3.0.1 sur ma Fedora 8 et j'ai un petit soucis au lancement. J'ai le message d'erreur suivant:
--
Traceback (most recent call last):
File "/usr/share/playonlinux/python/guiv3.py", line 25, in <module>
lib.lng.Lang()
File "/usr/share/playonlinux/python/lib/lng.py", line 13, in __init__
presLan = gettext.translation("pol", Variables.playonlinux_env+"/lang/locale", languages=[locale_[0]])
File "/usr/lib/python2.5/gettext.py", line 471, in translation
raise IOError(ENOENT, 'No translation file found for domain', domain)
IOError: [Errno 2] No translation file found for domain: 'pol'
--
et rien ne se passe... Quelqu'un sait-il de quel côté il faut que je regarde pour résoudre ce problème?
Erwan
|
Aymeric P. |
Zondag 1 Juni\ 2008 om 17:50
|
Aymeric P.
|
/me va prendre des vacances
Installe le paquet gettext si ce n'est déjà fait, mais apparemment c'est autre chose le problème.
Le rapport est quand même liée au locale ...
Sinon essaye de lancer POL comme ça : LC_ALL=C playonlinux
Former member.
|
Erwan |
Zondag 1 Juni\ 2008 om 18:28
|
Erwan
|
Merci pour la réponse rapide. Pas de doute, le diagnostique est le bon. C'est bien une histoire de locale mais LC_ALL=C playonlinux me donne un nouveau message d'erreur...
Traceback (most recent call last):
File "/usr/share/playonlinux/python/guiv3.py", line 25, in <module>
lib.lng.Lang()
File "/usr/share/playonlinux/python/lib/lng.py", line 11, in __init__
locale_test = string.split(locale_[0],"_")
File "/usr/lib/python2.5/string.py", line 290, in split
return s.split(sep, maxsplit)
AttributeError: 'NoneType' object has no attribute 'split'
Je vais essayer d'enquêter un peu plus de mon côté...
Erwan
|
Aymeric P. |
Zondag 1 Juni\ 2008 om 20:49
|
Aymeric P.
|
Bon c'est bizarre car j'ai demander sur IRC au quelque utilisateur de Fedora qu'il y avait si il avait le problème et personne ne rencontre ton bug :|
Former member.
|
Erwan |
Maandag 2 Juni\ 2008 om 9:11
|
Erwan
|
Dans la série, l'informatique c'est fun. Ça marche sans soucis si je suis connecté comme root....
Erwan
|
Erwan |
Maandag 2 Juni\ 2008 om 22:10
|
Erwan
|
Bonsoir,
je pense avoir la clé du problème: getdefaultlocale est une "mauvaise" fonction, il faut changer de fonction... Cf http://bugs.python.org/issue813449 :
This is a known limitation: getdefaultlocale should not be
used in new code.
If the intention is to compute the locale's encoding,
locale.getpreferredencoding should be used instead.
Il suffit donc de remplacer dans /playonlinux/python/lib/lng.py la ligne
locale_ = locale.getdefaultlocale()
par
locale_ = locale.getpreferredencoding()
pour obtenir un comportement correct (en tout cas chez moi...)
Erwan
Aangepast door Erwan
|
Quentin PÂRIS |
Maandag 2 Juni\ 2008 om 22:24
|
Quentin PÂRIS
|
Merci Erwan pour ceci
Edit : Ouai mais non ça va pas . Ton code renvoit l'encodage Aangepast door Tinou
|
Erwan |
Maandag 2 Juni\ 2008 om 23:27
|
Erwan
|
Effectivement c'était n'importe quoi... Je progresse dans mon débug (et ma découverte de Python). Le problème arrive du fait que ma langue par défaut est "en_US"! locale_[0] vaut alors 'en_US' et locale_test[0]='en'.
Si je rajoute, juste après locale_test = string.split(locale_[0],"_")
--
if(locale_test[0]=='en'):
locale_=['fr']
--
ce qui est stupide, ça bloque plus et j'ai la version française. Plus drôle, si je fais
--
if(locale_test[0]=='en'):
locale_test=['fr'];
locale_=['fr']
--
j'obtiens la version anglaise...
Erwan qui n'a pas d'explication rationnelle!
|
Quentin PÂRIS |
Maandag 2 Juni\ 2008 om 23:33
|
Quentin PÂRIS
|
#!/usr/bin/python
import locale
print locale.getdefaultlocale()
ça donne quoi ?
|
Erwan |
Maandag 2 Juni\ 2008 om 23:45
|
Erwan
|
j'obtiens ça
('en_US', 'ISO8859-1')
|
vevmesteren |
Woensdag 4 Juni\ 2008 om 5:53
|
vevmesteren
|
Moi je obtiens ('en_CA', 'UTF8')
uBUNTU 8.04
python 2.5
gettext est la aussi
mais sauf ca les meme problemes
playonlinux
[sudo] password for valentin:
Traceback (most recent call last):
File "/usr/share/playonlinux/python/guiv3.py", line 25, in <module>
lib.lng.Lang()
File "/usr/share/playonlinux/python/lib/lng.py", line 13, in __init__
presLan = gettext.translation("pol", Variables.playonlinux_env+"/lang/locale", languages=[locale_[0]])
File "/usr/lib/python2.5/gettext.py", line 484, in translation
raise IOError(ENOENT, 'No translation file found for domain', domain)
IOError: [Errno 2] No translation file found for domain: 'pol'
ET
sudo LC_ALL=C playonlinux
Traceback (most recent call last):
File "/usr/share/playonlinux/python/guiv3.py", line 25, in <module>
lib.lng.Lang()
File "/usr/share/playonlinux/python/lib/lng.py", line 11, in __init__
locale_test = string.split(locale_[0],"_")
File "/usr/lib/python2.5/string.py", line 290, in split
return s.split(sep, maxsplit)
AttributeError: 'NoneType' object has no attribute 'split'
Aangepast door vevmesteren
|
Erwan |
Zaterdag 14 Juni\ 2008 om 15:22
|
Erwan
|
Cela semble corrigé dans la version 3.0.2
Erwan
|