[Python-modules-commits] [python-django] 06/08: merge debian/patched-master into debian/master
Raphaël Hertzog
hertzog at moszumanska.debian.org
Mon Apr 4 14:51:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
hertzog pushed a commit to branch debian/master
in repository python-django.
commit 5d940466e1a609760ceee29bbe3682161f90a59b
Merge: f89fae7 a99b1ea
Author: Raphaël Hertzog <hertzog at debian.org>
Date: Mon Apr 4 15:40:17 2016 +0200
merge debian/patched-master into debian/master
Django.egg-info/PKG-INFO | 2 +-
Django.egg-info/SOURCES.txt | 2 +
PKG-INFO | 2 +-
debian/.git-dpm | 6 +--
.../patches/02_disable-sources-in-sphinxdoc.diff | 2 +-
.../06_use_debian_geoip_database_as_default.diff | 2 +-
.../fix-25761-add-traceback-attribute.patch | 2 +-
django/__init__.py | 2 +-
.../static/admin/js/admin/RelatedObjectLookups.js | 8 ++++
.../contrib/admin/templates/admin/change_form.html | 8 ----
django/contrib/auth/forms.py | 9 +++-
.../contrib/gis/db/backends/postgis/operations.py | 2 +-
.../gis/db/backends/spatialite/operations.py | 2 +-
django/contrib/gis/sitemaps/views.py | 3 +-
django/contrib/postgres/forms/jsonb.py | 15 ++++++
django/contrib/sitemaps/__init__.py | 2 +-
.../management/commands/collectstatic.py | 14 ++++--
django/core/cache/backends/base.py | 10 ++--
django/core/management/base.py | 2 +-
django/db/backends/sqlite3/schema.py | 10 +++-
django/db/migrations/autodetector.py | 2 +-
django/db/models/__init__.py | 4 +-
django/db/models/base.py | 10 +++-
django/db/models/fields/__init__.py | 3 +-
django/db/models/query.py | 6 +--
django/db/models/sql/query.py | 2 +-
django/http/multipartparser.py | 5 +-
django/middleware/common.py | 21 ++++----
django/template/backends/django.py | 17 +++++--
django/template/loaders/cached.py | 27 +++++++++--
docs/howto/deployment/wsgi/modwsgi.txt | 7 ++-
docs/howto/error-reporting.txt | 10 ++--
.../contributing/writing-documentation.txt | 6 +--
docs/internals/howto-release-django.txt | 2 +-
docs/intro/reusable-apps.txt | 4 +-
docs/intro/tutorial01.txt | 14 ++++++
docs/intro/tutorial02.txt | 2 +-
docs/intro/tutorial03.txt | 28 ++---------
docs/intro/tutorial07.txt | 3 +-
docs/ref/class-based-views/generic-date-based.txt | 2 +-
docs/ref/class-based-views/generic-editing.txt | 2 +-
docs/ref/class-based-views/mixins-simple.txt | 2 +-
docs/ref/contrib/gis/geoquerysets.txt | 7 +--
docs/ref/contrib/gis/install/index.txt | 2 +-
docs/ref/contrib/postgres/aggregates.txt | 2 +-
docs/ref/contrib/postgres/fields.txt | 14 +++++-
docs/ref/contrib/sitemaps.txt | 37 +++++++-------
docs/ref/django-admin.txt | 9 +++-
docs/ref/forms/api.txt | 5 ++
docs/ref/forms/widgets.txt | 8 ++--
docs/ref/models/fields.txt | 6 +++
docs/ref/settings.txt | 4 +-
docs/ref/utils.txt | 2 +-
docs/ref/views.txt | 2 +-
docs/releases/1.0.txt | 2 +-
docs/releases/1.8.12.txt | 20 ++++++++
docs/releases/1.9.5.txt | 51 ++++++++++++++++++++
docs/releases/index.txt | 2 +
docs/releases/security.txt | 2 +-
docs/topics/auth/default.txt | 2 +-
docs/topics/conditional-view-processing.txt | 2 +-
docs/topics/db/aggregation.txt | 2 +-
docs/topics/db/optimization.txt | 2 +-
docs/topics/pagination.txt | 7 ++-
docs/topics/performance.txt | 2 +-
docs/topics/serialization.txt | 3 +-
docs/topics/templates.txt | 18 +++++--
docs/topics/testing/advanced.txt | 2 +-
tests/admin_views/admin.py | 8 ++++
tests/admin_views/tests.py | 17 +++++++
tests/aggregation/tests.py | 2 +-
tests/aggregation_regress/tests.py | 2 +-
tests/annotations/tests.py | 2 +-
tests/auth_tests/test_forms.py | 56 ++++++++++++++++++++++
tests/cache/tests.py | 11 ++++-
tests/delete/tests.py | 4 +-
tests/expressions/tests.py | 2 +-
tests/expressions_case/tests.py | 2 +-
tests/file_uploads/tests.py | 35 ++++++++++++++
tests/fixtures/tests.py | 1 +
tests/generic_relations_regress/tests.py | 2 +-
tests/gis_tests/geo3d/models.py | 2 -
tests/gis_tests/geoadmin/models.py | 2 -
tests/gis_tests/geoapp/models.py | 8 ----
tests/gis_tests/inspectapp/models.py | 4 --
tests/gis_tests/layermap/models.py | 2 -
tests/gis_tests/models.py | 1 -
tests/gis_tests/relatedapp/models.py | 3 --
tests/gis_tests/relatedapp/tests.py | 8 ++--
tests/gis_tests/test_measure.py | 2 +-
tests/middleware/tests.py | 7 +--
tests/model_fields/test_durationfield.py | 6 +++
tests/model_inheritance/tests.py | 29 +++++++++--
tests/postgres_tests/test_json.py | 21 ++++++++
tests/queries/tests.py | 10 ++--
tests/schema/models.py | 5 ++
tests/schema/tests.py | 19 +++++++-
tests/select_related_regress/tests.py | 2 +-
tests/signing/tests.py | 2 +-
tests/staticfiles_tests/storage.py | 37 ++++++++++++++
tests/staticfiles_tests/test_management.py | 5 ++
tests/template_tests/test_loaders.py | 43 +++++++++++++++--
tests/update/tests.py | 2 +-
103 files changed, 648 insertions(+), 215 deletions(-)
diff --cc debian/.git-dpm
index 74bff87,0000000..50a2a62
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,11 -1,0 +1,11 @@@
+# see git-dpm(1) from git-dpm package
- 9a0c9a8c732f39a7f72a0b3991e53b2e7a14dc0c
- 9a0c9a8c732f39a7f72a0b3991e53b2e7a14dc0c
- b849285b12d9ba5635c7c84b03652d81ae147dac
++a99b1eaa49f2622b0ce4e1873c313e7cac789ec7
++a99b1eaa49f2622b0ce4e1873c313e7cac789ec7
++2d44413e8c1748908cc49a72ffe13021ddff88cc
+2d44413e8c1748908cc49a72ffe13021ddff88cc
+python-django_1.9.5.orig.tar.gz
+76fd84704650dca90b9c5ee0f6b7ab1132dcb3f5
+7430219
+debianTag="debian/%e%v"
+patchedTag="debian/patches/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/02_disable-sources-in-sphinxdoc.diff
index e555786,0000000..f37a521
mode 100644,000000..100644
--- a/debian/patches/02_disable-sources-in-sphinxdoc.diff
+++ b/debian/patches/02_disable-sources-in-sphinxdoc.diff
@@@ -1,33 -1,0 +1,33 @@@
- From 2f6bc22aef2f102ddcfeb9e8810d6dc7acaa4971 Mon Sep 17 00:00:00 2001
++From 2528a175d9697c3338eaf4782ef1fb5a8afe604b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog at debian.org>
+Date: Sun, 11 Oct 2015 11:43:19 +1100
+Subject: Disable creation of _sources directory by Sphinx
+
+ We do this to save some space as the sources of the documentation
+ are not really useful in a binary package.
+ .
+ This is a Debian specific patch.
+Forwarded: not-needed
+Origin: vendor
+
+Patch-Name: 02_disable-sources-in-sphinxdoc.diff
+---
+ docs/conf.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/docs/conf.py b/docs/conf.py
+index b146392..4182d61 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -211,7 +211,10 @@ html_additional_pages = {}
+ # html_split_index = False
+
+ # If true, links to the reST sources are added to the pages.
+-# html_show_sourcelink = True
++html_show_sourcelink = False
++
++# Do not ship a copy of the sources
++html_copy_source = False
+
+ # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+ # html_show_sphinx = True
diff --cc debian/patches/06_use_debian_geoip_database_as_default.diff
index 20332c4,0000000..2e87f30
mode 100644,000000..100644
--- a/debian/patches/06_use_debian_geoip_database_as_default.diff
+++ b/debian/patches/06_use_debian_geoip_database_as_default.diff
@@@ -1,69 -1,0 +1,69 @@@
- From 3cda4aac09b082edc33322bef37fb6483397d2c9 Mon Sep 17 00:00:00 2001
++From 0b29b5030bd47c14a49b46679a39d1374e2a2e87 Mon Sep 17 00:00:00 2001
+From: Tapio Rantala <tapio.rantala at iki.fi>
+Date: Sun, 11 Oct 2015 11:43:20 +1100
+Subject: Use Debian GeoIP database path as default
+
+ Default to Debian standard path for GeoIP directory and for GeoIP city
+ file. Avoids the need to declare them in each project.
+ .
+ This is a Debian specific patch.
+Bug-Debian: http://bugs.debian.org/645094
+Forwarded: not-needed
+
+Patch-Name: 06_use_debian_geoip_database_as_default.diff
+---
+ django/contrib/gis/geoip/base.py | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/django/contrib/gis/geoip/base.py b/django/contrib/gis/geoip/base.py
+index d40ae7e..1e33033 100644
+--- a/django/contrib/gis/geoip/base.py
++++ b/django/contrib/gis/geoip/base.py
+@@ -68,7 +68,8 @@ class GeoIP(object):
+ * path: Base directory to where GeoIP data is located or the full path
+ to where the city or country data files (*.dat) are located.
+ Assumes that both the city and country data sets are located in
+- this directory; overrides the GEOIP_PATH settings attribute.
++ this directory. Overrides the GEOIP_PATH settings attribute.
++ If neither is set, defaults to '/usr/share/GeoIP'.
+
+ * cache: The cache settings when opening up the GeoIP datasets,
+ and may be an integer in (0, 1, 2, 4, 8) corresponding to
+@@ -77,11 +78,13 @@ class GeoIP(object):
+ settings, respectively. Defaults to 0, meaning that the data is read
+ from the disk.
+
+- * country: The name of the GeoIP country data file. Defaults to
+- 'GeoIP.dat'; overrides the GEOIP_COUNTRY settings attribute.
++ * country: The name of the GeoIP country data file. Overrides
++ the GEOIP_COUNTRY settings attribute. If neither is set,
++ defaults to 'GeoIP.dat'
+
+- * city: The name of the GeoIP city data file. Defaults to
+- 'GeoLiteCity.dat'; overrides the GEOIP_CITY settings attribute.
++ * city: The name of the GeoIP city data file. Overrides the
++ GEOIP_CITY settings attribute. If neither is set, defaults
++ to 'GeoIPCity.dat'.
+ """
+
+ warnings.warn(
+@@ -98,9 +101,7 @@ class GeoIP(object):
+
+ # Getting the GeoIP data path.
+ if not path:
+- path = GEOIP_SETTINGS.get('GEOIP_PATH')
+- if not path:
+- raise GeoIPException('GeoIP path must be provided via parameter or the GEOIP_PATH setting.')
++ path = GEOIP_SETTINGS.get('GEOIP_PATH', '/usr/share/GeoIP')
+ if not isinstance(path, six.string_types):
+ raise TypeError('Invalid path type: %s' % type(path).__name__)
+
+@@ -113,7 +114,7 @@ class GeoIP(object):
+ self._country = GeoIP_open(force_bytes(country_db), cache)
+ self._country_file = country_db
+
+- city_db = os.path.join(path, city or GEOIP_SETTINGS.get('GEOIP_CITY', 'GeoLiteCity.dat'))
++ city_db = os.path.join(path, city or GEOIP_SETTINGS.get('GEOIP_CITY', 'GeoIPCity.dat'))
+ if os.path.isfile(city_db):
+ self._city = GeoIP_open(force_bytes(city_db), cache)
+ self._city_file = city_db
diff --cc debian/patches/fix-25761-add-traceback-attribute.patch
index ef84a92,0000000..e1e0830
mode 100644,000000..100644
--- a/debian/patches/fix-25761-add-traceback-attribute.patch
+++ b/debian/patches/fix-25761-add-traceback-attribute.patch
@@@ -1,82 -1,0 +1,82 @@@
- From 9a0c9a8c732f39a7f72a0b3991e53b2e7a14dc0c Mon Sep 17 00:00:00 2001
++From a99b1eaa49f2622b0ce4e1873c313e7cac789ec7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog at debian.org>
+Date: Wed, 25 Nov 2015 12:54:52 +0100
+Subject: Fix #25761 -- re-raised exceptions need __cause__.__traceback__
+
+When Django re-raises an exception, it sets the __cause__ attribute even
+in Python 2, thus mimicking Python's 3 behaviour for "raise Foo from Bar".
+However Python 3 also ensures that all exceptions have a __traceback__
+attribute and thus the "traceback2" Python 2 module (backport of Python
+3's "traceback" module) relies on the fact that whenever you have a
+__cause__ attribute, the recorded exception also has a __traceback__
+attribute.
+
+This is breaking at least testtools which is using traceback2 (see
+https://github.com/testing-cabal/testtools/issues/162).
+
+This commit fixes this inconsistency by ensuring that Django sets
+the __traceback__ attribute on any exception stored in a __cause__
+attribute of a re-raised exception.
+
+Patch-Name: fix-25761-add-traceback-attribute.patch
+---
+ django/db/migrations/loader.py | 2 ++
+ django/db/utils.py | 2 ++
+ django/utils/timezone.py | 2 ++
+ docs/ref/exceptions.txt | 4 +++-
+ 4 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
+index 310a4d0..7ef5e9d 100644
+--- a/django/db/migrations/loader.py
++++ b/django/db/migrations/loader.py
+@@ -272,6 +272,8 @@ class MigrationLoader(object):
+ ),
+ missing)
+ exc_value.__cause__ = exc
++ if not hasattr(exc, '__traceback__'):
++ exc.__traceback__ = sys.exc_info()[2]
+ six.reraise(NodeNotFoundError, exc_value, sys.exc_info()[2])
+ raise exc
+
+diff --git a/django/db/utils.py b/django/db/utils.py
+index 380a4b9..73ed6a6 100644
+--- a/django/db/utils.py
++++ b/django/db/utils.py
+@@ -88,6 +88,8 @@ class DatabaseErrorWrapper(object):
+ if issubclass(exc_type, db_exc_type):
+ dj_exc_value = dj_exc_type(*exc_value.args)
+ dj_exc_value.__cause__ = exc_value
++ if not hasattr(exc_value, '__traceback__'):
++ exc_value.__traceback__ = traceback
+ # Only set the 'errors_occurred' flag for errors that may make
+ # the connection unusable.
+ if dj_exc_type not in (DataError, IntegrityError):
+diff --git a/django/utils/timezone.py b/django/utils/timezone.py
+index 70fd5e3..205cac4 100644
+--- a/django/utils/timezone.py
++++ b/django/utils/timezone.py
+@@ -146,6 +146,8 @@ class LocalTimezone(ReferenceLocalTimezone):
+ exc_value = exc_type(
+ "Unsupported value: %r. You should install pytz." % dt)
+ exc_value.__cause__ = exc
++ if not hasattr(exc, '__traceback__'):
++ exc.__traceback__ = sys.exc_info()[2]
+ six.reraise(exc_type, exc_value, sys.exc_info()[2])
+
+ utc = pytz.utc if pytz else UTC()
+diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt
+index 46a0c81..a16d352 100644
+--- a/docs/ref/exceptions.txt
++++ b/docs/ref/exceptions.txt
+@@ -201,7 +201,9 @@ As per :pep:`3134`, a ``__cause__`` attribute is set with the original
+ (underlying) database exception, allowing access to any additional
+ information provided. (Note that this attribute is available under
+ both Python 2 and Python 3, although :pep:`3134` normally only applies
+-to Python 3.)
++to Python 3. With Python 2, Django will also record the traceback in the
++``__traceback__`` attribute of the exception made available via
++``__cause__``.)
+
+ .. exception:: models.ProtectedError
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django.git
More information about the Python-modules-commits
mailing list