On Ma, 2007-01-22 at 12:26 +0100, Olivier Salaün - CRU wrote:
> Felipe Gil Castiñeira wrote:
> > Daniel Espinosa wrote:
> >
> >> I was updating the Spanish translation for 0.11rc and when I found a
> >> misspelled word I change it ("Segerir" to "Sugerir"), then when I
> >> review again the sugestions pootle shows me this translation and who
> >> (in this case me) made the sugestion I accepted it and pootle sends
> >> the following message:
> >>
> >> 'ascii' codec can't decode byte 0xc3 in position 63: ordinal not in
> >> range(128)
> >>
> >> When I click on "back" link it sends me to the review sugestions page
> >> and goes to the next suggestion I click on accept button the Pootle
> >> sends the same error message.
> >>
> >>
> >>
> > I have the same problem updating the Galician translation:
> >
> > 'ascii' codec can't decode byte 0xc3 in position 28: ordinal not in
> > range(128)
> >
> > Or
> >
> > list index out of range
> >
>
> I was just reported the same problem from one of our translators of Sympa.
> I found additional informations from the Pootle log file :
>
> 2007-01-19 23:14:56: 127.0.0.1 - Fach [19/Jan/2007 23:14:56] "GET
> /br/sympa/ HTTP/1.1" 200 -
>
> 2007-01-19 23:15:41: Traceback (most recent call last): File
> "/usr/lib/python2.4/site-packages/Pootle/users.py", line 222, in handle
> page = self.getpage(pathwords, session, argdict)
> File "/usr/lib/python2.4/site-packages/Pootle/pootle.py", line
> 427, in getpage return translatepage.TranslatePage(project, session,
> argdict, dirfilter=pofilename)
> File "/usr/lib/python2.4/site-packages/Pootle/translatepage.py",
> line 71, in __init__ items = self.maketable()
> File "/usr/lib/python2.4/site-packages/Pootle/translatepage.py",
> line 391, in maketable self.translations = self.gettranslations()
> File "/usr/lib/python2.4/site-packages/Pootle/translatepage.py",
> line 379, in gettranslations rows = self.getdisplayrows("view")
> File "/usr/lib/python2.4/site-packages/Pootle/translatepage.py",
> line 360, in getdisplayrows usernode = self.getusernode()
> File "/usr/lib/python2.4/site-packages/Pootle/translatepage.py",
> line 320, in getusernode return
> getattr(self.session.loginchecker.users, self.session.username, None)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
> position 2: ordinal not in range(128)
>
> It looks like the problem might be related to the 8bit characters in the
> user's ID (Fañch).
>
> I changed our users.prefs file to remove the 'ñ' character :
> Before :
>
> u'Fañch':
> activated = 1
> activationcode = 'xxx'
> email = u'xxx'
> name = u'xxx'
> passwdhash = 'xxx'
> uilanguage = u'br'
>
> After
>
> Fanch:
> activated = 1
> ...
>
Thank you, Olivier.
Did this solve the problem? It seems to be a different problem than
what Felipe is reporting. I'm quite sure his username only has ascii
characters and the error seems to be in position 28 - a bit far down for
a username (same for Daniel's problem). I've never been convinced that
non-ascii usernames work 100% everywhere, and this seems to confirm it.
Of course, if we can fix Pootle, it would however be much better than
renaming the user to a misspelling :-/
Olivier, can you perhaps test whether the following resolves the problem
with the non-ascii username? I didn't test it myself yet.
--- translatepage.py (revision 4808)
+++ translatepage.py (working copy)
@@ -344,7 +344,7 @@
def getusernode(self):
"""gets the user's prefs node"""
if self.session.isopen:
- return getattr(self.session.loginchecker.users, self.session.username,
None)
+ return getattr(self.session.loginchecker.users,
self.session.username.encode("utf-8"), None)
else:
return None
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle