Since the update of Django to use Benjamin Peterson's six package for
single code-base compatibility, I've updated my port [1] to do
likewise. All tests pass [2] with the SQLite backend on Ubuntu Linux
(64-bit). I added to the small section at the end of six.py [3] of
additional customisations for Django's use. Some of these additions
may be removable in due course if appropriate changes are made to
Django. The additions are IMO uncontroversial - mostly, they are to
support uniform access for APIs which return lists on 2.x and
iterators on 3.x.

BTW, many tests fail if six's default StringIO is used on 2.x (this is
StringIO.StringIO). However, cStringIO.StringIO works in those cases.
I've tackled this by using

from django.utils.six.moves import StringIO

wherever possible, but

from django.utils.six import StringIO

where necessary. The former resolves to StringIO.StringIO on 2.x,
while the latter resolves to cStringIO.StringIO. On 3.x, both resolve
to io.StringIO and there are no failures due to StringIO usage.

I'm currently unable to test with other backends, but will try to
resolve any port-related problems which are fed back to me via the
GitHub issue tracker on the repo [4]. Note that my changes are in the
django3 branch, and not the master branch.

Regards,

Vinay Sajip

[1] https://github.com/vsajip/django
[2] https://gist.github.com/1373553
[3] https://github.com/vsajip/django/blob/django3/django/utils/six.py#L356
[4] https://github.com/vsajip/django/issues/new

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to