Migrating Pology to Python 3

Luigi Toscano luigi.toscano at tiscali.it
Sun Dec 25 16:39:22 GMT 2022


Johnny Jazeix ha scritto:
> 
> Le sam. 24 déc. 2022 à 15:28, Luigi Toscano <luigi.toscano at tiscali.it
> <mailto:luigi.toscano at tiscali.it>> a écrit :
> 
>     Johnny Jazeix ha scritto:
>     > Hi,
>     >
>     > I've spotted an issue when using posieve with check_rules or check-spell and
>     > wanted to output in xml.
>     > https://invent.kde.org/sdk/pology/-/blob/python3/sieve/check_rules.py#L211
>     > does not like the decode().
>     > The same exists in
>     > https://invent.kde.org/sdk/pology/-/blob/python3/sieve/check_spell.py#L116
>     >
>     > I'm not sure if only removing the "
>     |.decode(locale.getpreferredencoding()| "
>     > or how to replace it to keep this functionality.
>     >
> 
> 
>     I've tried your suggestion and it seems to be the right way, thus making
>     check-rules work, I'm going to push a change.
> 
>     The problem with check_spell, on the other hand, is that it seems broken even
>     with python2, as the call to aspell leads to a segmentation fault, at least on
>     Debian testing. check_spell wraps aspell directly, calling the C library. My
>     suggestion would be to drop check_spell completely and use check_spell_ec,
>     which is based on the enchant library, which works. Maybe even rename it as
>     check_spell. Unfortunately it doesn't support XML output right now.
> 
> 
> Thank you!
> For check_spell, yes, it segfauts too on my computer (archlinux) and other
> French translators. I've tried using the latest version of pyaspell
> (https://github.com/WojciechMula/aspell-python/blob/master/pyaspell/pyaspell.py)
> but didn't work better, it still crashes in
> https://invent.kde.org/sdk/pology/-/blob/python3/pology/external/pyaspell.py#L68.

Maybe something changed in the library signature, or in general in the way
python interfaces with the library. Not sure.

> 
> I haven't tested check_spell_ec, I'll take a look later.

In the meantime, I've tried to add support for XML output to check_spell_ec:

https://invent.kde.org/sdk/pology/-/merge_requests/8

Can you please try it and vote on the review? If it works, I would vote for
completely replacing check_spell (Chusslove?).

Ciao
-- 
Luigi


More information about the kde-i18n-doc mailing list