Bug 4867 - convert ThinLinc to Python 3
Summary: convert ThinLinc to Python 3
Status: CLOSED DUPLICATE of bug 4586
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.12.0
Assignee: Peter Åstrand
URL:
Keywords:
Depends on:
Blocks: 4586
  Show dependency treegraph
 
Reported: 2013-10-24 09:43 CEST by Pierre Ossman
Modified: 2020-02-04 13:00 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2013-10-24 09:43:21 CEST
Python 2 is in maintenance mode so it will not see any future development. The world is therefore gradually switching over to Python 3 instead. The distributions are also trying to avoid shipping Python 2 at all (see bug 4586). Upstream plans to EOL Python 2 in May 2015.

Since Python 2 is a dead end we should look at migrating to Python 3. The question is when though. Relevant factors:

 - Which distributions lack an easy way of installing Python 3?
 - Which ship with Python 3 by default?
 - Which ship with Python 2 by default?

There will probably never be a perfect time for this migration as there will likely be a period where there are relevant distributions that have only Python 2 by default, and other that only have Python 3 by default.
Comment 1 Pierre Ossman cendio 2014-04-07 10:44:55 CEST
Another thing to consider is if the external projects that we depend on have been converted to Python 3. E.g. Cheetah seems to have been abandoned and other users are switching to other template engines for Python 3.
Comment 2 Peter Åstrand cendio 2017-08-16 15:37:45 CEST
https://lwn.net/Articles/729366/
Comment 4 Karl Mikaelsson cendio 2018-11-23 17:26:33 CET
A few notes from my Python 3 adventures:

Porting to Python 3 is easier if we avoid using modules that are deprecated already in Python 2. This branch changes our code to use email instead of rfc822 and hashlib over sha/md5.

 http://git.cendio.se/cgit/~derfian/thinlinc.git/log/?h=stop-using-deprecated-python-modules


Using the __future__ module in Python 2.6 onwards would allow us to modify our code to be more future-compatible. Two major things:

> from __future__ import print_function

This allows us to move to print-as-a-function rather than print-as-a-statement with our code.

> from __future__ import absolute_import

This one is so nice I want to use it regardless if we're porting to Python 3 or not. Require relative imports to be explicitly marked as such, making it a breeze to see whether an import is supposed to be from a system module or a sibling.

Bad:
> from xmlrpc import XMLRPCChannel                # implicit relative
Good:
> from .xmlrpc import XMLRPCChannel               # explicit relative
> from thinlinc.vsm.xmlrpc import XMLRPCChannel   # absolute
Comment 5 Pierre Ossman cendio 2020-02-04 12:59:52 CET

*** This bug has been marked as a duplicate of bug 4586 ***

Note You need to log in before you can comment on or make changes to this bug.