coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
930 stars 374 forks source link

ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' #217

Closed sweta-creoit closed 4 years ago

sweta-creoit commented 4 years ago

Checklist

Steps to reproduce

ERROR:(/cities/models.py) from django.utils.encoding import python_2_unicode_compatible ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

As per latest version of Django==Django==3.0.2, the python_2_unicode_compatible has been moved to six.py , need to get updated So that django-cities/models.py can pick from six.py package.

Expected behavior

In /cities/models.py , the import should be: from six import python_2_unicode_compatible

Actual behavior

In /cities/models.py , the import is: from django.utils.encoding import python_2_unicode_compatible

blag commented 4 years ago

Fixed by #214. I'll try to get around to updating the tests and merging that PR soon.