Migrating Pology to Python 3

Albert Astals Cid aacid at kde.org
Sat Dec 24 10:17:04 GMT 2022


El diumenge, 18 de desembre de 2022, a les 13:13:25 (CET), Johnny Jazeix va 
escriure:
> 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.

For those of us that have no idea how to use posieve but know a bit of coding.

What's the command line invocation we have to do to get that error?

Cheers,
  Albert

> 
> Cheers,
> 
> Johnny
> 
> Le sam. 8 oct. 2022 à 18:04, Karl Ove Hufthammer <karl at huftis.org> a écrit :
> > Adrian Chaves skreiv 08.10.2022 17:11:
> > > This is caused by
> > > https://kingant.net/2019/01/rounding-numbers-in-python-2-and-python-3/
> > > 
> > > When plural forms are found, the average is calculated and rounded. In
> > > Python 2, round(2.5) is 3, in Python 3 round(2.5) is 2.
> > > 
> > > I have no strong opinion on the matter, but I am slightly inclined to
> > > keep the Python 3 behavior on this.
> > 
> > Yes, I see no reason not to use Python’s default rounding rules. But is
> > there a reason that the average and not the sum is calculated
> > (Chusslove)? After all, the sum *is* the number of words in the English
> > source text (or translation).
> > 
> > 
> > --
> > Karl Ove Hufthammer






More information about the kde-i18n-doc mailing list