Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fails in Django 3.0 #101

Closed
C0DK opened this issue Dec 10, 2019 · 9 comments
Closed

[BUG] Fails in Django 3.0 #101

C0DK opened this issue Dec 10, 2019 · 9 comments

Comments

@C0DK
Copy link

C0DK commented Dec 10, 2019

After upgrading to django 3.0, the module fails, it seems, due to some dependency on python_2 things from django, which might have been removed or changed. AFAIK python2 isn't officially supported anywhere anymore in 20~ days.

  File ".../venv/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File ".../venv/lib/python3.8/site-packages/multiselectfield/__init__.py", line 1, in <module>
    from multiselectfield.db.fields import MultiSelectField  # noqa: F401
  File ".../venv/lib/python3.8/site-packages/multiselectfield/db/fields.py", line 23, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (.../venv/lib/python3.8/site-packages/django/utils/encoding.py)
@tomasgarzon
Copy link
Collaborator

Hi, thanks for reporting this bug. Should we remove support for python2 here?
Anyway, this bug comes from Django 3.0, doesn't it?

@C0DK
Copy link
Author

C0DK commented Dec 10, 2019

Sorry - yes - django3.0 - i'll edit the title

Maybe you could also utilize the new enum types that django officially support now. https://docs.djangoproject.com/en/3.0/ref/models/fields/#field-choices-enum-types

I'd probably create a "final" python2 version, and then slowly drop support, if i were you guys. It's a mess to support both it'd say.

@C0DK C0DK changed the title [BUG] Fails in python3.8 [BUG] Fails in Django 3.0 Dec 10, 2019
@tomasgarzon
Copy link
Collaborator

Hi, could you paste your pip freeze? which version have you installed? The current version doesn't have "python_2_unicode_compatible"

@C0DK
Copy link
Author

C0DK commented Dec 16, 2019

"django-multiselectfield==0.1.8" it seems.

@tomasgarzon
Copy link
Collaborator

ok, please update to last version 0.1.10.

@Ryan-F-Dyer
Copy link

django-multiselect fields doesn not work on latest Django and Python combination due to python_2_unicode_compatible dependency

Django 3.1.1
Python 3.8.5
django-multipleselectfield 0.2.0.post2

Please assist with any feedback.

@LeeMellon
Copy link

LeeMellon commented Dec 16, 2020

Same issue
django-multiselectfield==0.1.12
python 3.6.4
django 3.0.7

##Update
Had to specifically use pip3 to install. Seems to be working now.

@eldamir
Copy link

eldamir commented Nov 8, 2021

Python 3.8.10
Django 3.2.x
django-multiselectfield==0.1.12

Same problem as above. Had nobody made a fix for this yet? 🤔

@blag
Copy link
Collaborator

blag commented May 24, 2024

Fixed in #148.

@blag blag closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants