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

Django 3.0 - No module names 'django.utils.six' #849

Closed
python-force opened this issue Mar 3, 2020 · 4 comments
Closed

Django 3.0 - No module names 'django.utils.six' #849

python-force opened this issue Mar 3, 2020 · 4 comments

Comments

@python-force
Copy link

Six was removed in Django 3.0

https://github.com/jschneier/django-storages/blob/master/storages/backends/s3boto3.py
from django.utils.six.moves.urllib import parse as urlparse

@jdufresne
Copy link
Contributor

This issue will be fixed by PR #709.

@python-force
Copy link
Author

Do you know probably when? - the PR was opened 10 months ago

@rjmackay
Copy link

rjmackay commented Apr 14, 2020

I think this may already be fixed? It looks like six is now only imported if it's available. 0ab2b1e

@jschneier
Copy link
Owner

Fixed in 1.8

jschneier pushed a commit that referenced this issue Jun 6, 2020
* 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 #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 #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.
mlazowik pushed a commit to qedsoftware/django-storages that referenced this issue Mar 9, 2022
* 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.
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

4 participants