Open moonshoes87 opened 7 years ago
Yeah, this is one of the few no goes of backwards compatibility. It basically has to do with the kind of string encoding the json library expects which differs between python2 and 3 and has to do with the whole EVERYTHING UNICODE of python3. It also results in having these .decode and .encode methods of some objects which allow use of UTF-8 and other methods to switch between encodings, which just don't exist in python2 so if you use them there goes python2 compatibility. This proves to be a small nightmare I have solved this by just accepting that where we use the power of the json we must give up backwards compatibility with python2 as I just can't seem to get it to work both ways.
Right. So, for this not to be the nail in the coffin, we would have to have two separate data_model modules (or functions within the modules) that are Python version specific?
As far as I can tell yes. I tried to hack my way around this for a while, but it just doesn't seem possible.
Can we discuss the difficulties of backwards compatibility here? I wasn't sure from our conversations exactly how much of a possibility that is.
In trying to run some of this updated code with Python 2, some things work off the bat. The first substantial issue I ran into was with reading json:
Is it worth trying to work through some of these issues, or not?