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