[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#859872: marked as done (unblock (pre-approval): flask/0.12.1-1)



Your message dated Thu, 13 Apr 2017 09:50:00 +0000
with message-id <67d2479b-eb00-1487-791e-7667717dcd23@thykier.net>
and subject line Re: Bug#859872: unblock (pre-approval): flask/0.12.1-1
has caused the Debian Bug report #859872,
regarding unblock (pre-approval): flask/0.12.1-1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
859872: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859872
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please consider unblocking of flask 0.12.1-1.

This upstream bugfix release fixies this 4 upstream bugs:
- Prevent `flask run` from showing a NoAppException when an ImportError occurs
  within the imported application module.
- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix
  ``#2118``.
- Use the ``SERVER_NAME`` config if it is present as default values for
  ``app.run``. ``#2109``, ``#2152``
- Call `ctx.auto_pop` with the exception object instead of `None`, in the
  event that a `BaseException` such as `KeyboardInterrupt` is raised in a
  request handler.

And fix unreproducibility build, which is simple fix in docs building.

Debdiff attached.

Thanks.

unblock flask/0.12.1-1

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru flask-0.12/CHANGES flask-0.12.1/CHANGES
--- flask-0.12/CHANGES	2016-12-21 21:19:09.000000000 +0100
+++ flask-0.12.1/CHANGES	2017-03-31 18:43:21.000000000 +0200
@@ -3,6 +3,31 @@
 
 Here you can see the full list of changes between each Flask release.
 
+Version 0.13
+------------
+
+Major release, unreleased
+
+- Make `app.run()` into a noop if a Flask application is run from the
+  development server on the command line.  This avoids some behavior that
+  was confusing to debug for newcomers.
+- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()
+  method returns compressed response by default, and pretty response in
+  debug mode.
+
+Version 0.12.1
+--------------
+
+Bugfix release, released on March 31st 2017
+
+- Prevent `flask run` from showing a NoAppException when an ImportError occurs
+  within the imported application module.
+- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix
+  ``#2118``.
+- Call `ctx.auto_pop` with the exception object instead of `None`, in the
+  event that a `BaseException` such as `KeyboardInterrupt` is raised in a
+  request handler.
+
 Version 0.12
 ------------
 
diff -Nru flask-0.12/debian/changelog flask-0.12.1/debian/changelog
--- flask-0.12/debian/changelog	2016-12-25 16:01:11.000000000 +0100
+++ flask-0.12.1/debian/changelog	2017-01-13 10:48:48.000000000 +0100
@@ -1,3 +1,10 @@
+flask (0.12.1-1) UNRELEASED; urgency=medium
+
+  * New upstream bugfix release
+  * Use SOURCE_DATE_EPOCH for copyright year to make build reproducible
+
+ -- Ondřej Nový <onovy@debian.org>  Fri, 13 Jan 2017 10:48:48 +0100
+
 flask (0.12-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru flask-0.12/debian/.git-dpm flask-0.12.1/debian/.git-dpm
--- flask-0.12/debian/.git-dpm	2016-12-25 14:58:29.000000000 +0100
+++ flask-0.12.1/debian/.git-dpm	2017-01-13 10:48:48.000000000 +0100
@@ -1,11 +1,11 @@
 # see git-dpm(1) from git-dpm package
-5219a1a4a282c1277f9c6b1cd4324e8c2d7b95f7
-5219a1a4a282c1277f9c6b1cd4324e8c2d7b95f7
-5219a1a4a282c1277f9c6b1cd4324e8c2d7b95f7
-5219a1a4a282c1277f9c6b1cd4324e8c2d7b95f7
-flask_0.12.orig.tar.gz
-73722d79e479d5f6b09bbb7b746c34a99b81b05c
-531923
+02ae596d3b6eb5e3c4fe1d938dbd86cee32f5b52
+02ae596d3b6eb5e3c4fe1d938dbd86cee32f5b52
+e2758a2dfc6ebddb68ccdfd8d3fa4cdd1a5ff03e
+e2758a2dfc6ebddb68ccdfd8d3fa4cdd1a5ff03e
+flask_0.12.1.orig.tar.gz
+b32d88f36f7a7d262eb6a336b4f0736cfa2a4252
+548511
 debianTag="debian/%e%v"
 patchedTag="patched/%e%v"
 upstreamTag="upstream/%e%u"
diff -Nru flask-0.12/debian/patches/0001-Use-SOURCE_DATE_EPOCH-for-copyright-year-to-make-bui.patch flask-0.12.1/debian/patches/0001-Use-SOURCE_DATE_EPOCH-for-copyright-year-to-make-bui.patch
--- flask-0.12/debian/patches/0001-Use-SOURCE_DATE_EPOCH-for-copyright-year-to-make-bui.patch	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/debian/patches/0001-Use-SOURCE_DATE_EPOCH-for-copyright-year-to-make-bui.patch	2017-01-13 10:48:48.000000000 +0100
@@ -0,0 +1,37 @@
+From 02ae596d3b6eb5e3c4fe1d938dbd86cee32f5b52 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= <onovy@debian.org>
+Date: Fri, 13 Jan 2017 10:46:21 +0100
+Subject: Use SOURCE_DATE_EPOCH for copyright year to make build reproducible
+
+---
+ docs/conf.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/docs/conf.py b/docs/conf.py
+index b37427a..81106a3 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -11,10 +11,13 @@
+ # All configuration values have a default; values that are commented out
+ # serve to show the default.
+ from __future__ import print_function
+-from datetime import datetime
+ import os
+ import sys
+ import pkg_resources
++import time
++import datetime
++
++BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
+ 
+ # If extensions (or modules to document with autodoc) are in another directory,
+ # add these directories to sys.path here. If the directory is relative to the
+@@ -49,7 +52,7 @@ master_doc = 'index'
+ 
+ # General information about the project.
+ project = u'Flask'
+-copyright = u'2010 - {0}, Armin Ronacher'.format(datetime.utcnow().year)
++copyright = u'2010 - {0}, Armin Ronacher'.format(BUILD_DATE.year)
+ 
+ # The version info for the project you're documenting, acts as replacement for
+ # |version| and |release|, also used in various other places throughout the
diff -Nru flask-0.12/debian/patches/series flask-0.12.1/debian/patches/series
--- flask-0.12/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/debian/patches/series	2017-01-13 10:48:48.000000000 +0100
@@ -0,0 +1 @@
+0001-Use-SOURCE_DATE_EPOCH-for-copyright-year-to-make-bui.patch
diff -Nru flask-0.12/examples/flaskr/flaskr.egg-info/dependency_links.txt flask-0.12.1/examples/flaskr/flaskr.egg-info/dependency_links.txt
--- flask-0.12/examples/flaskr/flaskr.egg-info/dependency_links.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/flaskr/flaskr.egg-info/dependency_links.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1 @@
+
diff -Nru flask-0.12/examples/flaskr/flaskr.egg-info/PKG-INFO flask-0.12.1/examples/flaskr/flaskr.egg-info/PKG-INFO
--- flask-0.12/examples/flaskr/flaskr.egg-info/PKG-INFO	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/flaskr/flaskr.egg-info/PKG-INFO	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: flaskr
+Version: 0.0.0
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
diff -Nru flask-0.12/examples/flaskr/flaskr.egg-info/requires.txt flask-0.12.1/examples/flaskr/flaskr.egg-info/requires.txt
--- flask-0.12/examples/flaskr/flaskr.egg-info/requires.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/flaskr/flaskr.egg-info/requires.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1 @@
+flask
\ No newline at end of file
diff -Nru flask-0.12/examples/flaskr/flaskr.egg-info/SOURCES.txt flask-0.12.1/examples/flaskr/flaskr.egg-info/SOURCES.txt
--- flask-0.12/examples/flaskr/flaskr.egg-info/SOURCES.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/flaskr/flaskr.egg-info/SOURCES.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1,15 @@
+MANIFEST.in
+README
+setup.cfg
+flaskr/__init__.py
+flaskr/flaskr.py
+flaskr/schema.sql
+flaskr.egg-info/PKG-INFO
+flaskr.egg-info/SOURCES.txt
+flaskr.egg-info/dependency_links.txt
+flaskr.egg-info/requires.txt
+flaskr.egg-info/top_level.txt
+flaskr/static/style.css
+flaskr/templates/layout.html
+flaskr/templates/login.html
+flaskr/templates/show_entries.html
\ No newline at end of file
diff -Nru flask-0.12/examples/flaskr/flaskr.egg-info/top_level.txt flask-0.12.1/examples/flaskr/flaskr.egg-info/top_level.txt
--- flask-0.12/examples/flaskr/flaskr.egg-info/top_level.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/flaskr/flaskr.egg-info/top_level.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1 @@
+flaskr
Binary files /tmp/74RgGT8Xd9/flask-0.12/examples/flaskr/pytest_runner-2.11.1-py2.7.egg and /tmp/fjgyHT1Am1/flask-0.12.1/examples/flaskr/pytest_runner-2.11.1-py2.7.egg differ
diff -Nru flask-0.12/examples/minitwit/minitwit.egg-info/dependency_links.txt flask-0.12.1/examples/minitwit/minitwit.egg-info/dependency_links.txt
--- flask-0.12/examples/minitwit/minitwit.egg-info/dependency_links.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/minitwit/minitwit.egg-info/dependency_links.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1 @@
+
diff -Nru flask-0.12/examples/minitwit/minitwit.egg-info/PKG-INFO flask-0.12.1/examples/minitwit/minitwit.egg-info/PKG-INFO
--- flask-0.12/examples/minitwit/minitwit.egg-info/PKG-INFO	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/minitwit/minitwit.egg-info/PKG-INFO	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: minitwit
+Version: 0.0.0
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
diff -Nru flask-0.12/examples/minitwit/minitwit.egg-info/requires.txt flask-0.12.1/examples/minitwit/minitwit.egg-info/requires.txt
--- flask-0.12/examples/minitwit/minitwit.egg-info/requires.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/minitwit/minitwit.egg-info/requires.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1 @@
+flask
\ No newline at end of file
diff -Nru flask-0.12/examples/minitwit/minitwit.egg-info/SOURCES.txt flask-0.12.1/examples/minitwit/minitwit.egg-info/SOURCES.txt
--- flask-0.12/examples/minitwit/minitwit.egg-info/SOURCES.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/minitwit/minitwit.egg-info/SOURCES.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1,16 @@
+MANIFEST.in
+README
+setup.cfg
+minitwit/__init__.py
+minitwit/minitwit.py
+minitwit/schema.sql
+minitwit.egg-info/PKG-INFO
+minitwit.egg-info/SOURCES.txt
+minitwit.egg-info/dependency_links.txt
+minitwit.egg-info/requires.txt
+minitwit.egg-info/top_level.txt
+minitwit/static/style.css
+minitwit/templates/layout.html
+minitwit/templates/login.html
+minitwit/templates/register.html
+minitwit/templates/timeline.html
\ No newline at end of file
diff -Nru flask-0.12/examples/minitwit/minitwit.egg-info/top_level.txt flask-0.12.1/examples/minitwit/minitwit.egg-info/top_level.txt
--- flask-0.12/examples/minitwit/minitwit.egg-info/top_level.txt	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/examples/minitwit/minitwit.egg-info/top_level.txt	2017-03-31 18:42:53.000000000 +0200
@@ -0,0 +1 @@
+minitwit
diff -Nru flask-0.12/flask/app.py flask-0.12.1/flask/app.py
--- flask-0.12/flask/app.py	2016-12-11 18:24:34.000000000 +0100
+++ flask-0.12.1/flask/app.py	2017-03-31 18:40:55.000000000 +0200
@@ -1983,6 +1983,9 @@
             except Exception as e:
                 error = e
                 response = self.handle_exception(e)
+            except:
+                error = sys.exc_info()[1]
+                raise
             return response(environ, start_response)
         finally:
             if self.should_ignore_error(error):
diff -Nru flask-0.12/flask/cli.py flask-0.12.1/flask/cli.py
--- flask-0.12/flask/cli.py	2016-12-11 18:24:34.000000000 +0100
+++ flask-0.12.1/flask/cli.py	2017-03-31 18:40:46.000000000 +0200
@@ -89,10 +89,16 @@
     try:
         __import__(module)
     except ImportError:
-        raise NoAppException('The file/path provided (%s) does not appear to '
-                             'exist.  Please verify the path is correct.  If '
-                             'app is not on PYTHONPATH, ensure the extension '
-                             'is .py' % module)
+        # Reraise the ImportError if it occurred within the imported module.
+        # Determine this by checking whether the trace has a depth > 1.
+        if sys.exc_info()[-1].tb_next:
+            raise
+        else:
+            raise NoAppException('The file/path provided (%s) does not appear'
+                                 ' to exist.  Please verify the path is '
+                                 'correct.  If app is not on PYTHONPATH, '
+                                 'ensure the extension is .py' % module)
+
     mod = sys.modules[module]
     if app_obj is None:
         app = find_best_app(mod)
diff -Nru flask-0.12/flask/config.py flask-0.12.1/flask/config.py
--- flask-0.12/flask/config.py	2016-12-11 18:24:34.000000000 +0100
+++ flask-0.12.1/flask/config.py	2017-02-10 12:20:32.000000000 +0100
@@ -126,7 +126,7 @@
         d = types.ModuleType('config')
         d.__file__ = filename
         try:
-            with open(filename) as config_file:
+            with open(filename, mode='rb') as config_file:
                 exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
         except IOError as e:
             if silent and e.errno in (errno.ENOENT, errno.EISDIR):
diff -Nru flask-0.12/flask/__init__.py flask-0.12.1/flask/__init__.py
--- flask-0.12/flask/__init__.py	2016-12-21 21:22:08.000000000 +0100
+++ flask-0.12.1/flask/__init__.py	2017-03-31 18:43:36.000000000 +0200
@@ -10,7 +10,7 @@
     :license: BSD, see LICENSE for more details.
 """
 
-__version__ = '0.12'
+__version__ = '0.12.1'
 
 # utilities we import from Werkzeug and Jinja2 that are unused
 # in the module but are exported as public interface.
diff -Nru flask-0.12/Flask.egg-info/PKG-INFO flask-0.12.1/Flask.egg-info/PKG-INFO
--- flask-0.12/Flask.egg-info/PKG-INFO	2016-12-21 21:22:09.000000000 +0100
+++ flask-0.12.1/Flask.egg-info/PKG-INFO	2017-03-31 18:43:36.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Flask
-Version: 0.12
+Version: 0.12.1
 Summary: A microframework based on Werkzeug, Jinja2 and good intentions
 Home-page: http://github.com/pallets/flask/
 Author: Armin Ronacher
diff -Nru flask-0.12/Flask.egg-info/requires.txt flask-0.12.1/Flask.egg-info/requires.txt
--- flask-0.12/Flask.egg-info/requires.txt	2016-12-21 21:22:09.000000000 +0100
+++ flask-0.12.1/Flask.egg-info/requires.txt	2017-03-31 18:43:36.000000000 +0200
@@ -1,4 +1,4 @@
 Werkzeug>=0.7
 Jinja2>=2.4
 itsdangerous>=0.21
-click>=2.0
+click>=2.0
\ No newline at end of file
diff -Nru flask-0.12/Flask.egg-info/SOURCES.txt flask-0.12.1/Flask.egg-info/SOURCES.txt
--- flask-0.12/Flask.egg-info/SOURCES.txt	2016-12-21 21:22:09.000000000 +0100
+++ flask-0.12.1/Flask.egg-info/SOURCES.txt	2017-03-31 18:43:36.000000000 +0200
@@ -122,11 +122,17 @@
 examples/flaskr/.gitignore
 examples/flaskr/MANIFEST.in
 examples/flaskr/README
+examples/flaskr/pytest_runner-2.11.1-py2.7.egg
 examples/flaskr/setup.cfg
 examples/flaskr/setup.py
 examples/flaskr/flaskr/__init__.py
 examples/flaskr/flaskr/flaskr.py
 examples/flaskr/flaskr/schema.sql
+examples/flaskr/flaskr.egg-info/PKG-INFO
+examples/flaskr/flaskr.egg-info/SOURCES.txt
+examples/flaskr/flaskr.egg-info/dependency_links.txt
+examples/flaskr/flaskr.egg-info/requires.txt
+examples/flaskr/flaskr.egg-info/top_level.txt
 examples/flaskr/flaskr/static/style.css
 examples/flaskr/flaskr/templates/layout.html
 examples/flaskr/flaskr/templates/login.html
@@ -143,6 +149,11 @@
 examples/minitwit/minitwit/__init__.py
 examples/minitwit/minitwit/minitwit.py
 examples/minitwit/minitwit/schema.sql
+examples/minitwit/minitwit.egg-info/PKG-INFO
+examples/minitwit/minitwit.egg-info/SOURCES.txt
+examples/minitwit/minitwit.egg-info/dependency_links.txt
+examples/minitwit/minitwit.egg-info/requires.txt
+examples/minitwit/minitwit.egg-info/top_level.txt
 examples/minitwit/minitwit/static/style.css
 examples/minitwit/minitwit/templates/layout.html
 examples/minitwit/minitwit/templates/login.html
@@ -209,6 +220,7 @@
 tests/test_apps/blueprintapp/apps/frontend/templates/frontend/index.html
 tests/test_apps/cliapp/__init__.py
 tests/test_apps/cliapp/app.py
+tests/test_apps/cliapp/importerrorapp.py
 tests/test_apps/cliapp/multiapp.py
 tests/test_apps/subdomaintestmodule/__init__.py
 tests/test_apps/subdomaintestmodule/static/hello.txt
\ No newline at end of file
diff -Nru flask-0.12/PKG-INFO flask-0.12.1/PKG-INFO
--- flask-0.12/PKG-INFO	2016-12-21 21:22:09.000000000 +0100
+++ flask-0.12.1/PKG-INFO	2017-03-31 18:43:37.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Flask
-Version: 0.12
+Version: 0.12.1
 Summary: A microframework based on Werkzeug, Jinja2 and good intentions
 Home-page: http://github.com/pallets/flask/
 Author: Armin Ronacher
diff -Nru flask-0.12/tests/test_apps/cliapp/importerrorapp.py flask-0.12.1/tests/test_apps/cliapp/importerrorapp.py
--- flask-0.12/tests/test_apps/cliapp/importerrorapp.py	1970-01-01 01:00:00.000000000 +0100
+++ flask-0.12.1/tests/test_apps/cliapp/importerrorapp.py	2017-02-10 12:20:32.000000000 +0100
@@ -0,0 +1,7 @@
+from __future__ import absolute_import, print_function
+
+from flask import Flask
+
+raise ImportError()
+
+testapp = Flask('testapp')
diff -Nru flask-0.12/tests/test_basic.py flask-0.12.1/tests/test_basic.py
--- flask-0.12/tests/test_basic.py	2016-12-11 18:24:34.000000000 +0100
+++ flask-0.12.1/tests/test_basic.py	2017-03-31 18:40:55.000000000 +0200
@@ -791,6 +791,23 @@
         assert resp.data == b'internal server error'
 
 
+def test_baseexception_error_handling():
+    app = flask.Flask(__name__)
+    app.config['LOGGER_HANDLER_POLICY'] = 'never'
+
+    @app.route('/')
+    def broken_func():
+        raise KeyboardInterrupt()
+
+    with app.test_client() as c:
+        with pytest.raises(KeyboardInterrupt):
+            c.get('/')
+
+        ctx = flask._request_ctx_stack.top
+        assert ctx.preserved
+        assert type(ctx._preserved_exc) is KeyboardInterrupt
+
+
 def test_before_request_and_routing_errors():
     app = flask.Flask(__name__)
 
diff -Nru flask-0.12/tests/test_cli.py flask-0.12.1/tests/test_cli.py
--- flask-0.12/tests/test_cli.py	2016-12-11 18:24:34.000000000 +0100
+++ flask-0.12.1/tests/test_cli.py	2017-03-31 18:40:46.000000000 +0200
@@ -83,6 +83,7 @@
     pytest.raises(NoAppException, locate_app, "notanpp.py")
     pytest.raises(NoAppException, locate_app, "cliapp/app")
     pytest.raises(RuntimeError, locate_app, "cliapp.app:notanapp")
+    pytest.raises(ImportError, locate_app, "cliapp.importerrorapp")
 
 
 def test_find_default_import_path(test_apps, monkeypatch, tmpdir):
diff -Nru flask-0.12/tests/test_config.py flask-0.12.1/tests/test_config.py
--- flask-0.12/tests/test_config.py	2016-12-11 18:24:34.000000000 +0100
+++ flask-0.12.1/tests/test_config.py	2017-02-10 12:20:32.000000000 +0100
@@ -7,11 +7,14 @@
     :license: BSD, see LICENSE for more details.
 """
 
-import pytest
 
-import os
 from datetime import timedelta
+import os
+import textwrap
+
 import flask
+from flask._compat import PY2
+import pytest
 
 
 # config keys used for the TestConfig
@@ -187,3 +190,18 @@
     assert 2 == len(bar_options)
     assert 'bar stuff 1' == bar_options['BAR_STUFF_1']
     assert 'bar stuff 2' == bar_options['BAR_STUFF_2']
+
+
+@pytest.mark.parametrize('encoding', ['utf-8', 'iso-8859-15', 'latin-1'])
+def test_from_pyfile_weird_encoding(tmpdir, encoding):
+    f = tmpdir.join('my_config.py')
+    f.write_binary(textwrap.dedent(u'''
+    # -*- coding: {0} -*-
+    TEST_VALUE = "föö"
+    '''.format(encoding)).encode(encoding))
+    app = flask.Flask(__name__)
+    app.config.from_pyfile(str(f))
+    value = app.config['TEST_VALUE']
+    if PY2:
+        value = value.decode(encoding)
+    assert value == u'föö'

--- End Message ---
--- Begin Message ---
Ondrej Novy:
> Control: tags -1 - moreinfo
> 
> Uploaded and built. Thanks.
> 

--- End Message ---

Reply to: