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

Re: [GSoC] Profiling SQL query (Was: [GSoC] Reg Blends Web Sentinel)



Hi,

On Sun, Mar 22, 2015 at 02:03:31AM +0530, Akshita Jha wrote:
> I have sent a patch fixing the above mentioned unicode error in tasks.py
> for debian-med.
> 
> The error was due to characters present in the 'long description' of some
> dependencies in the 'unofficial' and 'prospective' packages. Also, there
> were some 'authors' names in the dependencies of 'wnpp' package that had
> the same issue. I wrote a try-except block in blendstasktools.py which
> encodes these characters for 'xhtml' rendering.

Sounds very plausible.
 
> Now, there are no zero sized html files in /srv/
> blends.debian.org/www/med/tasks.

I tested it and can confirm that no zero size tasks files are created
any more.  However, there is some issue left since the logfile keeps on
listing errors:

Traceback (most recent call last):
  File "./tasks.py", line 181, in <module>
    print >> f, template.generate(**data).render('xhtml')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 1274: ordinal not in range(128)


> Also,
> $ find /srv/blends.debian.org/www -name "*.html" -size 0, gives the
> following output, which I don't think is relevant to tasks.py:
> 
> /srv/blends.debian.org/www/gis/bugs/data.html
> ...

No that's not a tasks.py issue.  The dirname under

   /srv/blends.debian.org/www/$BLEND/

correlates to the python script name - so .../bugs was created by
bugs.py.

> There are no errors for debian-med, debian-games, debian-gis, debian-junior
> and debian-edu.
> The 'except' block in the patch has nothing for now, as I am not sure where
> exactly to log the errors. If you could help me with that, I'll modify the
> code.

Use

   logger.error(messagestring)

to notify the Blends creator.  This is written to logs/$BLEND_$script.err.

> Can you please go through the patch and let me know in case of any issues.

I commited it and tested it locally.  While the created files are
non-zero only three languages are created (en, cs, da).  I guess the
problem starts with 'de' which comes alphabethically next and contains
non-ASCII characters typically.  Your observation that the codes behave
differently when the text comes from UDD and from the tasks files is
what I mean that it is probably not possible to convert the whole
resulting data before feeding them to Genshi.

Please simply commit your patches to Git.  That's for you any me way
more convenient than the Git - export - mail - import interface we used
for the past patches. :-)

Kind regards

      Andreas.


-- 
http://fam-tille.de


Reply to: