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

List:       kde-i18n-doc
Subject:    Re: Making pology python3 compatible
From:       Luigi Toscano <luigi.toscano () tiscali ! it>
Date:       2019-06-17 9:00:07
Message-ID: e33b2197-70bc-ca20-3d85-c868372c86f4 () tiscali ! it
[Download RAW message or body]

Chusslove Illich ha scritto:
>> [: Shinjo Park :]
>> I tested a blind conversion of 2to3 and execution didn't worked well (also
>> gave minor warnings). Running posieve on 2to3-processed files gave errors
>> on pology/colors.py, possibly due to str/unicode changes and separation on
>> py3. Any other parts utilizing string needs to be examined, especially
>> decode() and encode() calls.
> 
> Right, that doesn't work, and 2to3 also produces too "dirty" modifications.
> So the way would be to run 2to3 and examine each modification in turn, check
> if it is needed at all or if it should be somewhat different. Afterwards
> also manually consider most frequent kinds of alterations when going from
> Python 2 to 3, where in the code such cases could be found.

Another idea could be the (at least partial) usage of porting libraries like
six of future).

They don't help with the most complicated porting issue (str vs byte), but
they can speed up with other changes. I've seen six used in OpenStack, and
future in other project.

Ciao
-- 
Luigi
[prev in list] [next in list] [prev in thread] [next in thread] 

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