-
-
Notifications
You must be signed in to change notification settings - Fork 867
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() #806
Comments
PR #709 addresses this issue. |
Hi @jschneier Would you consider looking at the fix put in place for this? When I run my project's test suite, I receive hundreds of warnings from django-storages that look like the OP. The output is too noisy to be useful and could easily hide other legitimate warnings I need to fix in my own projects. Python 2 is now officially EOL, so there is less need to continue supporting it. Using pypinfo, here are the pip statistics for this project from the last month. You can see that Python 2 downloads make up less than 18% and has been dropping.
EDIT: Users that wish to stay on Python 2.7 can continue to use the latest version of django-storages that supports Python 2. So they won't be left high and dry. |
* Drop support for Python 2 Python 2 support is nearing end of life. At the end of this year, it will no longer be supported, including for security issues. Django has already dropped support for Python 2 in Django 2.0. Follow upstream to be more compatible with the master branch as tests now pass. For more details, see https://pythonclock.org/ All code changes and clean ups that were noticed were done. Changes include: - Remove str/unicode compatibility shims. - Remove encoding cookies from source files. Python 3 interprets all files as utf-8 by default. - Remove unnecessary __future__ imports. The features are now built-in. - Use modern and simpler super() syntax. - Update the wheel configuration to reflect it is no longer universal. - Update trove classifiers. - And more … Also remove supported for end of life Python 3.4. It went end of life 2019-03-18. Fixes jschneier#849 * Update uses of force_text → force_str to avoid deprecation warnings Django deprecated force_text() and smart_text() in favor of force_str() and smart_str() in: django/django@d55e882 Fixes jschneier#806 * Remove unnecessary uses of (force|smart)_str As django-storages is now Python 3 only, handling both bytes & string paths is now unnecessary. In Python 3 with Django, paths are always a string. * Replace deprecated IOError with more specific FileNotFoundError Since Python 3.3, IOError has been merged into OSError. FileNotFoundError is a subclass, so its use is fully backwards compatible. * Remove unnecessary 'utf-8' from .encode()/.decode() In Python3, these methods default to UTF-8.
After recently upgrading to Django 3.0, I started to receive deprecation warnings for
force_text()
. As noted in the release notes:I noted that
django-storages
still supports Python 2.7, but I'm not sure if support for it is going to be dropped soon or otherwise. If we're interested to address this, i'll be more than happy to follow up with a PR.EDIT: Python 2.7 will be unsupported after January 1, 2020.
The text was updated successfully, but these errors were encountered: