Re: Cron <gnomeweb@window> $HOME/bin/logify cvs-update-www.gnome.org



Hi guys,

Today at 8:25, James Henstridge wrote:

> This is the error given at the end of the log:
>
> Traceback (most recent call last):
>   File "/usr/bin/xml2po", line 743, in ?
>     CurrentXmlMode.postProcessXmlTranslation(doc, translationlanguage, outtxt)
>   File "/usr/share/xml2po/docbook.py", line 190, in postProcessXmlTranslation
>     copy.newChild(None, "holder", holder)
>   File "/usr/lib/python2.2/site-packages/libxml2.py", line 3187, in newChild
>     ret = libxml2mod.xmlNewChild(self._o, ns__o, name, content)
> UnicodeError: ASCII encoding error: ordinal not in range(128)
>
>
> This looks like an error in xml2po.  The default unicode -> str
> conversion in Python is to convert to ASCII (this can be changed, but
> should not be relied on).
>
> Since the libxml2 bindings are set to accept strings rather than unicode
> strings the conversion occurs implicitly.  The fix would be for xml2po
> to explicitly encode unicode strings to UTF-8 before passing them to
> libxml2.
>
> Fixing this bug in xml2po and installing a new version on
> window.gnome.org would fix the problem.

This is already fixed, but window.gnome.org has older version
of gnome-doc-utils (0.2.0): 

2005-07-18  Danilo Šegan  <danilo gnome org>

        Fixes #310754.
        
        * modes/docbook.py (docbookXmlMode.postProcessXmlTranslation):
        Encode translator credits as UTF-8 for libxml2.

Version 0.2.2 of gnome-doc-utils (from gnome-2-10 branch) contains the
fix, as does 0.3.2 release.  Here is a patch that can be applied
directly to /usr/share/xml2po/docbook.py on window:

Index: docbook.py
===================================================================
RCS file: /cvs/gnome/gnome-doc-utils/xml2po/modes/docbook.py,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -r1.9 -r1.9.2.1
--- docbook.py  27 Mar 2005 17:00:05 -0000      1.9
+++ docbook.py  18 Jul 2005 19:20:30 -0000      1.9.2.1
@@ -187,7 +187,7 @@
                         holder = match.group(2)
                     else:
                         holder = "???"
-                    copy.newChild(None, "holder", holder)
+                    copy.newChild(None, "holder", holder.encode('utf-8'))
 
 # Perform some tests when ran standalone
 if __name__ == '__main__':


(though, applying it directly will most likely break packaging system). 

Cheers,
Danilo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]