[Python-modules-commits] [python-django] 06/07: merge debian/patched-master into debian/master

Raphaël Hertzog hertzog at moszumanska.debian.org
Tue Feb 2 08:40:58 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 d0d3777c28c91ffee1587edcb0f8c64c2a4eb961
Merge: 225b8b9 acea941
Author: Raphaël Hertzog <hertzog at debian.org>
Date:   Tue Feb 2 09:05:31 2016 +0100

    merge debian/patched-master into debian/master

 AUTHORS                                            |   3 +
 Django.egg-info/PKG-INFO                           |   2 +-
 Django.egg-info/SOURCES.txt                        |  30 +-
 PKG-INFO                                           |   2 +-
 debian/.git-dpm                                    |   6 +-
 .../patches/02_disable-sources-in-sphinxdoc.diff   |   4 +-
 .../06_use_debian_geoip_database_as_default.diff   |   2 +-
 .../fix-25761-add-traceback-attribute.patch        |   2 +-
 django/__init__.py                                 |   2 +-
 .../app_template/{__init__.py => __init__.py-tpl}  |   0
 .../conf/app_template/{admin.py => admin.py-tpl}   |   0
 django/conf/app_template/{apps.py => apps.py-tpl}  |   0
 .../migrations/{__init__.py => __init__.py-tpl}    |   0
 .../conf/app_template/{models.py => models.py-tpl} |   0
 .../conf/app_template/{tests.py => tests.py-tpl}   |   0
 .../conf/app_template/{views.py => views.py-tpl}   |   0
 .../project_template/{manage.py => manage.py-tpl}  |   0
 .../project_name/{__init__.py => __init__.py-tpl}  |   0
 .../project_name/{settings.py => settings.py-tpl}  |   0
 .../project_name/{urls.py => urls.py-tpl}          |   0
 .../project_name/{wsgi.py => wsgi.py-tpl}          |   0
 django/contrib/admin/options.py                    |  18 +-
 django/contrib/admin/sites.py                      |   8 +-
 .../static/admin/js/admin/DateTimeShortcuts.js     |   4 +-
 django/contrib/admin/static/admin/js/core.js       |   5 +-
 django/contrib/admin/utils.py                      |   2 +-
 django/contrib/auth/hashers.py                     |   2 +-
 django/contrib/gis/serializers/geojson.py          |   3 +
 django/contrib/gis/templates/gis/openlayers.html   |   5 +-
 django/core/management/templates.py                |  12 +-
 django/db/backends/base/operations.py              |   2 +-
 django/db/backends/mysql/creation.py               |   2 +-
 django/db/backends/postgresql/creation.py          |   2 +-
 django/db/backends/postgresql/schema.py            |   4 +-
 django/db/backends/sqlite3/operations.py           |  13 +
 django/db/migrations/questioner.py                 |   3 +
 django/db/models/fields/related.py                 |  21 +-
 django/db/models/sql/compiler.py                   |   2 +-
 django/dispatch/dispatcher.py                      |   6 +-
 django/forms/fields.py                             |   2 +
 django/middleware/common.py                        |   5 +-
 django/middleware/csrf.py                          |   2 +-
 django/middleware/http.py                          |   4 +-
 django/template/base.py                            |   8 +-
 django/template/defaultfilters.py                  |   2 +-
 django/template/smartif.py                         |   2 +-
 django/utils/functional.py                         |  20 +
 django/utils/http.py                               |   7 +
 django/utils/translation/trans_real.py             |   3 +
 django/views/debug.py                              |   2 +-
 docs/_ext/djangodocs.py                            |  41 +-
 docs/conf.py                                       |   2 +-
 docs/contents.txt                                  |   4 +-
 docs/faq/admin.txt                                 |  21 +-
 docs/faq/contributing.txt                          |   9 +-
 docs/faq/general.txt                               |  27 +-
 docs/faq/help.txt                                  |  11 +-
 docs/faq/install.txt                               |  11 +-
 docs/faq/models.txt                                |  13 +-
 docs/faq/usage.txt                                 |  11 +-
 docs/glossary.txt                                  |   2 -
 docs/howto/custom-file-storage.txt                 |   1 +
 docs/howto/custom-lookups.txt                      |  14 +-
 docs/howto/custom-management-commands.txt          |  42 +-
 docs/howto/custom-model-fields.txt                 |   2 +-
 docs/howto/custom-template-tags.txt                |  42 +-
 docs/howto/deployment/checklist.txt                |   7 +-
 docs/howto/deployment/index.txt                    |   1 +
 docs/howto/deployment/wsgi/apache-auth.txt         |   8 +-
 docs/howto/deployment/wsgi/index.txt               |   6 +-
 docs/howto/deployment/wsgi/modwsgi.txt             |  21 +-
 docs/howto/error-reporting.txt                     |  13 +-
 docs/howto/index.txt                               |   1 +
 docs/howto/outputting-csv.txt                      |   2 +-
 docs/howto/windows.txt                             |  12 +-
 docs/howto/writing-migrations.txt                  |   6 +-
 docs/index.txt                                     |   6 +-
 docs/internals/contributing/bugs-and-features.txt  |   8 +-
 docs/internals/contributing/committing-code.txt    |   8 +-
 docs/internals/contributing/localizing.txt         |   8 +-
 docs/internals/contributing/new-contributors.txt   |   6 +-
 docs/internals/contributing/triaging-tickets.txt   |  44 +-
 .../contributing/writing-code/coding-style.txt     |  16 +-
 .../contributing/writing-code/javascript.txt       |  16 +-
 .../writing-code/submitting-patches.txt            |  30 +-
 .../contributing/writing-code/unit-tests.txt       |  26 +-
 .../contributing/writing-code/working-with-git.txt |  19 +-
 .../contributing/writing-documentation.txt         |  53 +-
 docs/internals/deprecation.txt                     |   3 +-
 docs/internals/git.txt                             |   4 +-
 docs/internals/index.txt                           |   1 +
 docs/internals/mailing-lists.txt                   |  12 +-
 docs/internals/security.txt                        |   2 -
 docs/internals/team.txt                            |   7 +-
 docs/intro/index.txt                               |   1 +
 docs/intro/install.txt                             |  13 +-
 docs/intro/reusable-apps.txt                       |   7 +-
 docs/intro/tutorial03.txt                          |   2 +
 docs/misc/index.txt                                |   1 +
 docs/ref/applications.txt                          |   8 +-
 docs/ref/checks.txt                                |  18 +-
 docs/ref/class-based-views/base.txt                |  12 +-
 docs/ref/class-based-views/flattened-index.txt     |  90 ++-
 docs/ref/class-based-views/generic-date-based.txt  |  28 +-
 docs/ref/class-based-views/generic-display.txt     |   8 +-
 docs/ref/class-based-views/generic-editing.txt     |  16 +-
 docs/ref/class-based-views/index.txt               |   4 +-
 docs/ref/class-based-views/mixins-date-based.txt   |  24 +-
 docs/ref/class-based-views/mixins-editing.txt      |  16 +-
 .../class-based-views/mixins-multiple-object.txt   |   8 +-
 docs/ref/class-based-views/mixins-simple.txt       |   8 +-
 .../ref/class-based-views/mixins-single-object.txt |   8 +-
 docs/ref/clickjacking.txt                          |  14 +-
 docs/ref/contrib/admin/index.txt                   |   8 +-
 docs/ref/contrib/auth.txt                          |  17 +-
 docs/ref/contrib/contenttypes.txt                  |   3 +-
 docs/ref/contrib/gis/commands.txt                  |  24 +-
 docs/ref/contrib/gis/forms-api.txt                 |  24 +-
 docs/ref/contrib/gis/functions.txt                 | 104 +--
 docs/ref/contrib/gis/gdal.txt                      |   4 +-
 docs/ref/contrib/gis/geoip.txt                     |  16 +-
 docs/ref/contrib/gis/geoip2.txt                    |  12 +-
 docs/ref/contrib/gis/geoquerysets.txt              | 116 +--
 docs/ref/contrib/gis/geos.txt                      |   4 +-
 docs/ref/contrib/gis/install/geolibs.txt           |  16 +-
 docs/ref/contrib/gis/install/index.txt             |  32 +-
 docs/ref/contrib/gis/install/spatialite.txt        |  52 +-
 docs/ref/contrib/gis/model-api.txt                 |   4 +-
 docs/ref/contrib/gis/serializers.txt               |   6 +-
 docs/ref/contrib/gis/testing.txt                   |  18 +-
 docs/ref/contrib/gis/tutorial.txt                  |   4 +-
 docs/ref/contrib/humanize.txt                      |  34 +-
 docs/ref/contrib/index.txt                         |  52 +-
 docs/ref/contrib/postgres/aggregates.txt           |  76 +-
 docs/ref/contrib/postgres/fields.txt               | 147 ++--
 docs/ref/contrib/postgres/forms.txt                |  42 +-
 docs/ref/contrib/postgres/functions.txt            |   5 +-
 docs/ref/contrib/postgres/index.txt                |   1 +
 docs/ref/contrib/postgres/lookups.txt              |   4 +-
 docs/ref/contrib/postgres/operations.txt           |  13 +-
 docs/ref/contrib/postgres/validators.txt           |  10 +-
 docs/ref/contrib/sitemaps.txt                      |  10 +-
 docs/ref/contrib/staticfiles.txt                   |  65 +-
 docs/ref/contrib/syndication.txt                   |   8 +-
 docs/ref/csrf.txt                                  |  10 +-
 docs/ref/databases.txt                             |   2 +-
 docs/ref/django-admin.txt                          | 887 ++++++++++-----------
 docs/ref/files/file.txt                            |  15 +-
 docs/ref/files/storage.txt                         |  11 +-
 docs/ref/files/uploads.txt                         |   4 +-
 docs/ref/forms/api.txt                             |  48 +-
 docs/ref/forms/fields.txt                          |  96 +--
 docs/ref/forms/formsets.txt                        |   5 +-
 docs/ref/forms/models.txt                          |  13 +-
 docs/ref/forms/validation.txt                      |  21 +-
 docs/ref/forms/widgets.txt                         |  43 +-
 docs/ref/middleware.txt                            |   4 +-
 docs/ref/migration-operations.txt                  |  72 +-
 docs/ref/models/conditional-expressions.txt        |   8 +-
 docs/ref/models/database-functions.txt             |  36 +-
 docs/ref/models/fields.txt                         |   8 +-
 docs/ref/models/lookups.txt                        |  12 +-
 docs/ref/models/meta.txt                           |  28 +-
 docs/ref/models/querysets.txt                      | 317 ++++----
 docs/ref/models/relations.txt                      |   2 +-
 docs/ref/request-response.txt                      |  28 +-
 docs/ref/schema-editor.txt                         |  44 +-
 docs/ref/settings.txt                              | 771 +++++++++---------
 docs/ref/signals.txt                               |  68 +-
 docs/ref/template-response.txt                     |  18 +-
 docs/ref/templates/api.txt                         |  40 +-
 docs/ref/templates/builtins.txt                    | 394 ++++-----
 docs/ref/templates/language.txt                    |   2 +-
 docs/ref/unicode.txt                               |   2 +-
 docs/ref/urlresolvers.txt                          |  16 +-
 docs/ref/urls.txt                                  |  52 +-
 docs/ref/utils.txt                                 |  24 +-
 docs/releases/1.0-porting-guide.txt                |   2 +-
 docs/releases/1.1.3.txt                            |   2 +-
 docs/releases/1.1.4.txt                            |   2 +-
 docs/releases/1.2.4.txt                            |   2 +-
 docs/releases/1.2.5.txt                            |   8 +-
 docs/releases/1.2.txt                              |  14 +-
 docs/releases/1.3.4.txt                            |   2 +-
 docs/releases/1.3.5.txt                            |   4 +-
 docs/releases/1.3.6.txt                            |   8 +-
 docs/releases/1.3.txt                              |  84 +-
 docs/releases/1.4.10.txt                           |   2 +-
 docs/releases/1.4.2.txt                            |   2 +-
 docs/releases/1.4.3.txt                            |   4 +-
 docs/releases/1.4.4.txt                            |   8 +-
 docs/releases/1.4.6.txt                            |   2 +-
 docs/releases/1.4.7.txt                            |   2 +
 docs/releases/1.4.8.txt                            |   4 +-
 docs/releases/1.4.9.txt                            |   2 +-
 docs/releases/1.4.txt                              | 159 ++--
 docs/releases/1.5.2.txt                            |   4 +-
 docs/releases/1.5.3.txt                            |   4 +-
 docs/releases/1.5.4.txt                            |   4 +-
 docs/releases/1.5.5.txt                            |   4 +-
 docs/releases/1.5.txt                              | 100 +--
 docs/releases/1.6.txt                              | 118 +--
 docs/releases/1.7.txt                              | 220 ++---
 docs/releases/1.8.1.txt                            |   2 +-
 docs/releases/1.8.9.txt                            |  39 +
 docs/releases/1.8.txt                              | 259 +++---
 docs/releases/1.9.2.txt                            | 105 +++
 docs/releases/1.9.txt                              | 146 ++--
 docs/releases/index.txt                            |   2 +
 docs/releases/security.txt                         | 218 +++--
 docs/topics/auth/customizing.txt                   |  34 +-
 docs/topics/auth/default.txt                       |  38 +-
 docs/topics/auth/passwords.txt                     |   4 +-
 docs/topics/cache.txt                              |  10 +-
 docs/topics/checks.txt                             |   7 +-
 docs/topics/class-based-views/generic-display.txt  |   2 -
 docs/topics/class-based-views/generic-editing.txt  |  15 +-
 docs/topics/class-based-views/intro.txt            |   2 +-
 docs/topics/class-based-views/mixins.txt           |  20 +-
 docs/topics/conditional-view-processing.txt        |   2 +-
 docs/topics/db/aggregation.txt                     |  12 +-
 docs/topics/db/examples/many_to_many.txt           |   7 +-
 docs/topics/db/examples/many_to_one.txt            |   4 +-
 docs/topics/db/examples/one_to_one.txt             |   7 +-
 docs/topics/db/index.txt                           |   1 +
 docs/topics/db/managers.txt                        |  24 +-
 docs/topics/db/models.txt                          |  24 +-
 docs/topics/db/multi-db.txt                        |   9 +-
 docs/topics/db/optimization.txt                    |  16 +-
 docs/topics/db/queries.txt                         |  41 +-
 docs/topics/db/tablespaces.txt                     |   8 +-
 docs/topics/email.txt                              |  28 +-
 docs/topics/external-packages.txt                  |   6 +-
 docs/topics/files.txt                              |   2 +-
 docs/topics/forms/formsets.txt                     |  41 +-
 docs/topics/forms/index.txt                        |  14 +-
 docs/topics/forms/media.txt                        |  21 +-
 docs/topics/forms/modelforms.txt                   |  20 +-
 docs/topics/http/index.txt                         |   1 +
 docs/topics/http/middleware.txt                    |  24 +-
 docs/topics/http/sessions.txt                      |   9 +-
 docs/topics/http/shortcuts.txt                     |  20 +-
 docs/topics/http/urls.txt                          |   4 +-
 docs/topics/http/views.txt                         |   4 +-
 docs/topics/i18n/formatting.txt                    |  15 +-
 docs/topics/i18n/timezones.txt                     |  26 +-
 docs/topics/i18n/translation.txt                   |  37 +-
 docs/topics/index.txt                              |   1 +
 docs/topics/install.txt                            |  13 +-
 docs/topics/migrations.txt                         |  90 +--
 docs/topics/performance.txt                        |  24 +-
 docs/topics/python3.txt                            |  12 +-
 docs/topics/security.txt                           |   3 +-
 docs/topics/serialization.txt                      |  32 +-
 docs/topics/settings.txt                           |  16 +-
 docs/topics/signing.txt                            |   8 +-
 docs/topics/testing/advanced.txt                   |  12 +-
 docs/topics/testing/overview.txt                   |  22 +-
 docs/topics/testing/tools.txt                      |  67 +-
 js_tests/admin/core.test.js                        |  46 +-
 setup.cfg                                          |   2 +-
 .../project_template/{manage.py => manage.py-tpl}  |   0
 tests/admin_scripts/tests.py                       |   2 +-
 tests/admin_views/admin.py                         |  18 +-
 tests/admin_views/models.py                        |  20 +-
 tests/admin_views/tests.py                         | 148 +++-
 tests/apps/tests.py                                |   2 +-
 tests/backends/tests.py                            |  12 +
 .../test_order_with_respect_to.py                  |  17 +-
 tests/csrf_tests/tests.py                          |  17 +
 tests/expressions_case/tests.py                    |  13 +-
 tests/file_uploads/tests.py                        |   2 +-
 .../templates/forms_tests/article_form.html        |   2 +-
 tests/forms_tests/tests/test_forms.py              |   8 +
 tests/gis_tests/distapp/tests.py                   |   4 +-
 tests/gis_tests/geoapp/test_functions.py           |   2 +-
 tests/gis_tests/geoapp/test_serializers.py         |  17 +-
 tests/gis_tests/geogapp/tests.py                   |  16 +-
 tests/gis_tests/test_geoforms.py                   |   5 +-
 tests/i18n/tests.py                                |   6 +-
 tests/m2m_through/models.py                        |   1 +
 tests/m2m_through/tests.py                         |  17 +-
 tests/middleware/tests.py                          |   5 +
 tests/migrations/test_questioner.py                |  15 +
 tests/migrations/test_writer.py                    |   2 +
 tests/model_fields/tests.py                        |  54 ++
 .../{tests.py => base_tests.py}                    |  60 +-
 tests/order_with_respect_to/models.py              |   9 -
 tests/order_with_respect_to/tests.py               |  85 +-
 tests/project_template/test_settings.py            |  15 +
 tests/runtests.py                                  |  10 +-
 tests/schema/tests.py                              | 133 +--
 tests/template_tests/tests.py                      |   9 +
 tests/templates/form_view.html                     |   2 +-
 tests/templates/login.html                         |   2 +-
 tests/utils_tests/test_dateformat.py               |   3 +
 tests/utils_tests/test_http.py                     |   4 +-
 tests/utils_tests/test_lazyobject.py               |  85 +-
 298 files changed, 4528 insertions(+), 3880 deletions(-)

diff --cc debian/.git-dpm
index 48631c4,0000000..955bb2f
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
- 552d239ac0bb897ba85f1a2fe9c941efb14f797e
- 552d239ac0bb897ba85f1a2fe9c941efb14f797e
- 4c3207df476c2bbb3a7c107d692f7eae2a3bb744
++acea9419ff66c14d564734089a28413e23454d32
++acea9419ff66c14d564734089a28413e23454d32
++6e04957b7d59fceb9d1ce51839f6d6fa7d9b67f4
 +6e04957b7d59fceb9d1ce51839f6d6fa7d9b67f4
 +python-django_1.9.2.orig.tar.gz
 +3b761b2ba6a098572e39545251caef565bba3d5f
 +7419200
 +debianTag="debian/%e%v"
 +patchedTag="debian/patches/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/02_disable-sources-in-sphinxdoc.diff
index 553487e,0000000..9c582c5
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 02627b7e904a0ea7e238c79d6f119a7bd7906024 Mon Sep 17 00:00:00 2001
++From c8b85dea27394132d99a08594752da6aab7412a4 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 90d4a29..cf39d30 100644
++index b23f62d..94a8b72 100644
 +--- a/docs/conf.py
 ++++ b/docs/conf.py
 +@@ -202,7 +202,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 29db558,0000000..6b6dd3c
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 43dddcabcc6f08a4bae582b85e22a35c0f12d78c Mon Sep 17 00:00:00 2001
++From 5b9e2d6ad57a11c752bd6a5022045b027b47b98c 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 2a216b2,0000000..8f2a2e7
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 552d239ac0bb897ba85f1a2fe9c941efb14f797e Mon Sep 17 00:00:00 2001
++From acea9419ff66c14d564734089a28413e23454d32 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