[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Migrating Pology to Python 3
From:       Johnny Jazeix <jazeix () gmail ! com>
Date:       2022-12-24 14:58:51
Message-ID: CAEtcAPGQ8dOGkTK-K4Z7JHjuzf7dk9qk3UJqZvs4hH+7==rqSw () mail ! gmail ! com
[Download RAW message or body]

Le sam. 24 d=C3=A9c. 2022 =C3=A0 15:28, Luigi Toscano <luigi.toscano@tiscal=
i.it> a
=C3=A9crit :

> Johnny Jazeix ha scritto:
> > Hi,
> >
> > I've spotted an issue when using posieve with check_rules or check-spel=
l
> and
> > wanted to output in xml.
> >
> https://invent.kde.org/sdk/pology/-/blob/python3/sieve/check_rules.py#L21=
1
> > does not like the decode().
> > The same exists in
> >
> https://invent.kde.org/sdk/pology/-/blob/python3/sieve/check_spell.py#L11=
6
> >
> > 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.p=
y#L68
.

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

Johnny

Ciao
> --
> Luigi
>

[Attachment #3 (text/html)]

<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le  \
sam. 24 déc. 2022 à  15:28, Luigi Toscano &lt;<a \
href="mailto:luigi.toscano@tiscali.it">luigi.toscano@tiscali.it</a>&gt; 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> &gt; Hi,<br>
&gt; <br>
&gt; I&#39;ve spotted an issue when using posieve with check_rules or check-spell \
and<br> &gt; wanted to output in xml.<br>
&gt; <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>
 &gt; does not like the decode().<br>
&gt; The same exists in<br>
&gt; <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>
 &gt; <br>
&gt; I&#39;m not sure if only removing the &quot; \
|.decode(locale.getpreferredencoding()| &quot;<br> &gt; or how to replace it to keep \
this functionality.<br> &gt; <br>
<br>
<br>
I&#39;ve tried your suggestion and it seems to be the right way, thus making<br>
check-rules work, I&#39;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&#39;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&#39;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&#39;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&#39;t tested check_spell_ec, I&#39;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>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic