Signbank / FinSL-signbank

Web based database for sign language lexicons and corpuses. Fork of NGT-signbank (https://github.com/Signbank/Global-signbank).
https://signbank.csc.fi
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Port to python3 #244

Closed henrinie closed 7 years ago

henrinie commented 7 years ago

We want to move to using python3 instead of python2. We will be using python3.4 so that will the target version we support, most likely the code will run with most versions of python3. This move should be fairly easy, but surely some problems might come up during the switch. Please refer any errors and problems directly to me.

We don't really need backwards compatibility with python2, but it might be useful to have just in case someone in the future needs that. So the aim is to also offer that python2 support, but I will not give any guarantees yet.

henrinie commented 7 years ago

Ran into problem with having bytestrings (b'') in migration files generated with python2. Python3 wants to migrate these fields to text (unicodestrings), but the migrations won't run because the fields named with bytestrings aren't found. https://code.djangoproject.com/ticket/23226 https://code.djangoproject.com/ticket/23982 https://code.djangoproject.com/ticket/26385

So meanwhile trying to solve this issue, and support both python2 and python3, I found out that django will end support for python2 in 2.0, as stated on https://www.djangoproject.com/weblog/2015/jun/25/roadmap/

As a final heads up, Django 1.11 is likely to be the last version to support Python 2.7 as it will be supported until the end of Python 2 upstream support in 2020.

Django 2.0 is lined up to be released in December 2017, which we might make in time to upgrade in any case. After that there really is no need or point to support python2.

I have gotten the app mostly functional with both py2 and py3. If there are some issues left after fixing this latest problem with migrations, I might ditch the idea of providing further support for python2, as most likely we will need to remove unicode_literals for 2.0.

henrinie commented 7 years ago

Seems like things are now running smoothly with both python2 and python3. And when django 2.0 comes out, I guess we will be ripping out the python2 support. Closing.