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

RemovedInDjango40Warning: force_text() is deprecated in favor of force_str(). #1009

Closed
gh640 opened this issue Aug 19, 2020 · 11 comments
Closed

Comments

@gh640
Copy link
Contributor

gh640 commented Aug 19, 2020

This warning is printed on Django 3.1.

/usr/local/lib/python3.7/site-packages/compressor/cache.py:29: 
RemovedInDjango40Warning: force_text() is deprecated in favor of force_str().
    return 'django_compressor.%s' % force_text(key)
@gh640
Copy link
Contributor Author

gh640 commented Aug 19, 2020

Sorry, this was already fixed with #988 .

@gh640 gh640 closed this as completed Aug 19, 2020
@Steckelfisch
Copy link

But it has missed the 2.4.1 release. !t seems.

@diox
Copy link
Member

diox commented Jul 15, 2021

2.4.1 was branched off 2.4.0, so that's expected. 3.0 will fix this when this is released, in the meantime you can help by testing the develop branch.

@Steckelfisch
Copy link

Ok. Thanks. will do

@nijel
Copy link

nijel commented Sep 22, 2021

Any plans to release this fix? Django 4.0 removes force_text and Django 4.0 alpha 1 is now out, so people will be running into this:

django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'compressor.templatetags.compress': cannot import name 'force_text' from 'django.utils.encoding' (/opt/hostedtoolcache/Python/3.9.7/x64/lib/python3.9/site-packages/django/utils/encoding.py)

nijel added a commit to WeblateOrg/weblate that referenced this issue Sep 22, 2021
The edge build will be failing for some time until
django-compressor/django-compressor#1009
is fixed in a release.
@diox
Copy link
Member

diox commented Sep 22, 2021

You can help test the develop branch against Django 4.0 alpha 1 and report back, or help fix #1060 so that I can release 3.0, which would contain the fix for this issue.

@carltongibson
Copy link
Contributor

I've added testing against 4.0a1 in #1072 — there's a couple of unrelated failures, but it's generally green.

nijel added a commit to WeblateOrg/weblate that referenced this issue Sep 22, 2021
@nijel
Copy link

nijel commented Sep 22, 2021

I've added develop branch to our CI where we test against Django pre-releases, that should give it some testing as well.

@sumanthratna
Copy link

sumanthratna commented Dec 10, 2021

Sorry to bump an old thread, but when is the ETA for django-compressor 3.0? Django 4.0 was just realized but unfortunately, it can't be used with django-compressor because of the force_text error.

Happy to try and help with any minor remaining bug fixes.

@tomwojcik
Copy link

@sumanthratna for the time being install django_compressor with

git+git://github.com/django-compressor/django-compressor.git@ce972890f017a363c63bf41ab24a923b493ae97a

As Carl mentioned in another ticket, it should be released within a week.

@carltongibson
Copy link
Contributor

Yep. It's all done bar the administration for the release. It's coming. Installing from GitHub will have to do you if you can't wait a few days.

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

7 participants