#23763 closed New feature (fixed)
Python 3.5 compatibility
Reported by: | Tim Graham | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | berker.peksag@…, nick.a.sarbicki@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Python 3.5 is not scheduled for final until September 2015, but this is a tracking ticket for compatibility fixes for Django submitted in the meantime.
Change History (24)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
All the tests currently pass except for some ImportError
exceptions being reported, likely due to http://bugs.python.org/issue7559.
====================================================================== ERROR: apps.failing_app (unittest.loader.ModuleImportFailure) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tim/code/cpython/Lib/unittest/case.py", line 58, in testPartExecutor yield File "/home/tim/code/cpython/Lib/unittest/case.py", line 577, in run testMethod() File "/home/tim/code/cpython/Lib/unittest/loader.py", line 36, in testFailure raise exception ImportError: Failed to import test module: apps.failing_app Traceback (most recent call last): File "/home/tim/code/cpython/Lib/unittest/loader.py", line 451, in _find_test_path package = self._get_module_from_name(name) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 358, in _get_module_from_name __import__(name) File "/home/tim/code/django/tests/apps/failing_app/__init__.py", line 1, in <module> raise ImportError("Oops") ImportError: Oops ====================================================================== ERROR: migrations.faulty_migrations.import_error (unittest.loader.ModuleImportFailure) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tim/code/cpython/Lib/unittest/case.py", line 58, in testPartExecutor yield File "/home/tim/code/cpython/Lib/unittest/case.py", line 577, in run testMethod() File "/home/tim/code/cpython/Lib/unittest/loader.py", line 36, in testFailure raise exception ImportError: Failed to import test module: migrations.faulty_migrations.import_error Traceback (most recent call last): File "/home/tim/code/cpython/Lib/unittest/loader.py", line 451, in _find_test_path package = self._get_module_from_name(name) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 358, in _get_module_from_name __import__(name) File "/home/tim/code/django/tests/migrations/faulty_migrations/import_error/__init__.py", line 1, in <module> import fake_python_module # NOQA ImportError: No module named 'fake_python_module'
Also, some GIS related exceptions like the following if GIS dependencies aren't installed:
====================================================================== ERROR: django.contrib.gis.admin (unittest.loader.ModuleImportFailure) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tim/code/cpython/Lib/unittest/case.py", line 58, in testPartExecutor yield File "/home/tim/code/cpython/Lib/unittest/case.py", line 577, in run testMethod() File "/home/tim/code/cpython/Lib/unittest/loader.py", line 36, in testFailure raise exception ImportError: Failed to import test module: django.contrib.gis.admin Traceback (most recent call last): File "/home/tim/code/cpython/Lib/unittest/loader.py", line 451, in _find_test_path package = self._get_module_from_name(name) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 358, in _get_module_from_name __import__(name) File "/home/tim/code/django/django/contrib/gis/admin/__init__.py", line 7, in <module> from django.contrib.gis.admin.options import GeoModelAdmin # NOQA File "/home/tim/code/django/django/contrib/gis/admin/options.py", line 2, in <module> from django.contrib.gis.admin.widgets import OpenLayersWidget File "/home/tim/code/django/django/contrib/gis/admin/widgets.py", line 9, in <module> from django.contrib.gis.geos import GEOSGeometry, GEOSException ImportError: cannot import name 'GEOSGeometry'
comment:19 by , 9 years ago
Any thoughts on the GEOSGeometry import error on Python 3 only? I think I've applied all the relevant patches here for Ubuntu's build of 1.7.9 for Python 2.7, 3.4, and 3.5, and this is the last failure I can't yet eliminate. Well, I can if I depend on libgeos-dev which gives you the right library, but I don't want to add that dependency because of cross-pocket issues (django-python is in main, but libgeos-dev is in universe, and that would require extra bureaucracy to change).
I've confirmed that HAS_SPACIAL_DB is False in both Python 2 and 3, and django.contrib.gis.tests doesn't get added to discovery_paths (in runtests.py), but yet those tests are still discovered.
Is there some patch not yet attached to this issue, or some other ticket or commit I should be looking at?
comment:20 by , 9 years ago
I don't believe it's a known issue. It doesn't seem related to Python 3.5 compatibility, so please open a new ticket with more specifics, thanks!
comment:21 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The test suite for master (Django 1.9) passes on Python 3.5.
comment:22 by , 9 years ago
Cc: | added |
---|
In b07aa52e8a8e4c7fdc7265f75ce2e7992e657ae9: