[Python-modules-commits] [python-django] 06/07: merge debian/patched-jessie-backports into debian/jessie-backports
Raphaël Hertzog
hertzog at moszumanska.debian.org
Tue Sep 27 12:13:00 UTC 2016
This is an automated email from the git hooks/post-receive script.
hertzog pushed a commit to branch debian/jessie-backports
in repository python-django.
commit 86277baf86f3f74ee88aca4d291702fc853d240e
Merge: aaf1299 a8f249a
Author: Raphaël Hertzog <hertzog at debian.org>
Date: Tue Sep 27 13:45:23 2016 +0200
merge debian/patched-jessie-backports into debian/jessie-backports
Django.egg-info/PKG-INFO | 2 +-
Django.egg-info/SOURCES.txt | 1 +
PKG-INFO | 2 +-
debian/.git-dpm | 6 +--
...-Fixed-tests-with-older-releases-of-numpy.patch | 36 --------------
.../patches/02_disable-sources-in-sphinxdoc.diff | 2 +-
.../06_use_debian_geoip_database_as_default.diff | 2 +-
.../fix-25761-add-traceback-attribute.patch | 2 +-
debian/patches/series | 1 -
django/__init__.py | 2 +-
django/http/cookie.py | 29 ++++++------
.../static/docicons-behindscenes.png | Bin 49 -> 1065 bytes
.../djangodocs-epub/static/docicons-note.png | Bin 41 -> 559 bytes
.../djangodocs-epub/static/docicons-philosophy.png | Bin 47 -> 791 bytes
.../djangodocs-epub/static/docicons-warning.png | Bin 44 -> 782 bytes
docs/howto/deployment/wsgi/uwsgi.txt | 2 +-
docs/releases/1.8.15.txt | 18 +++++++
docs/releases/1.8.txt | 10 ++--
docs/releases/index.txt | 1 +
docs/releases/security.txt | 13 ++++++
tests/gis_tests/test_geoip.py | 8 ++--
tests/httpwrappers/tests.py | 52 ++++++++++++++++++++-
tests/middleware/test_security.py | 2 +-
tests/requests/tests.py | 5 +-
tests/template_tests/syntax_tests/test_numpy.py | 2 +-
25 files changed, 124 insertions(+), 74 deletions(-)
diff --cc debian/.git-dpm
index fec571b,0000000..a5ba7a2
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
- f014680b108081f0db2b084acd09d59985e3cc49
- f014680b108081f0db2b084acd09d59985e3cc49
- bda91e2a79160524c26fb87ca05f73b0132f5e0c
++a8f249a2b249680a891d1ed95a97efcf8fdb0b4d
++a8f249a2b249680a891d1ed95a97efcf8fdb0b4d
++ef4afdabb486be460f94a71fc40515c3590db64b
+ef4afdabb486be460f94a71fc40515c3590db64b
+python-django_1.8.15.orig.tar.gz
+5183e8e71bfcc1661ebd64a78feb5b2b8aff1239
+7295362
+debianTag="debian/%e%v"
+patchedTag="debian/patches/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/02_disable-sources-in-sphinxdoc.diff
index 63b4902,0000000..a9f285b
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 f7841a50c75221a0206e3f3f5743c3dc7ac77d41 Mon Sep 17 00:00:00 2001
++From 62113062476e5f479298d9544f463e9d622c051f 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 557ccfd..8fd8f1c 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -214,7 +214,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 5d308da,0000000..656f9d0
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 5efa3416d9b71473585d0d26ef4fa2daa720c7dd Mon Sep 17 00:00:00 2001
++From f6db1e5fa077de35700683b21d70e189e11d0e46 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 0b160ff..0420bba 100644
+--- a/django/contrib/gis/geoip/base.py
++++ b/django/contrib/gis/geoip/base.py
+@@ -66,7 +66,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
+@@ -75,11 +76,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'.
+ """
+ # Checking the given cache option.
+ if cache in self.cache_options:
+@@ -89,9 +92,7 @@ class GeoIP(object):
+
+ # Getting the GeoIP data path.
+ if not path:
+- path = GEOIP_SETTINGS.get('GEOIP_PATH', None)
+- 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__)
+
+@@ -104,7 +105,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 3bcfcb5,0000000..bb8f01e
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 e608615faa5e0be187c836732cc02dba97bb355f Mon Sep 17 00:00:00 2001
++From a8f249a2b249680a891d1ed95a97efcf8fdb0b4d 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 bbd60a6..8939537 100644
+--- a/django/db/migrations/loader.py
++++ b/django/db/migrations/loader.py
+@@ -287,6 +287,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 ccfcfd4..24020dc 100644
+--- a/django/db/utils.py
++++ b/django/db/utils.py
+@@ -91,6 +91,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 dbda90c..f64576d 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
+
diff --cc debian/patches/series
index d87a42f,0000000..4549594
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,4 -1,0 +1,3 @@@
+02_disable-sources-in-sphinxdoc.diff
+06_use_debian_geoip_database_as_default.diff
+fix-25761-add-traceback-attribute.patch
- 0004-Fixed-26923-Fixed-tests-with-older-releases-of-numpy.patch
--
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