Merge branch 'master' of github.com:mitsuhiko/flask
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents 05161d3, 29f3a1a · Browse files · 6 files·+26 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+26 added−4 removed
- other:+26 added−4 removed
Provenance
- Commit
51d7c8d- Tree
53df7f1- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
05161d3- Parent 2
29f3a1a
6 files changed+26 added−4 removed
modified:docs/deploying/fastcgi.rst+1 added
147 unmodified lines148 149 url.rewrite-once = (150 "^(/static($|/.*))$" => "$1",151 "^(/.*)$" => "/yourapplication.fcgi$1"152+ )153 154 Remember to enable the FastCGI, alias and rewrite modules. This configuration155 binds the application to `/yourapplication`. If you want the application to156 work in the URL root you have to work around a lighttpd bug with the83 unmodified linesmodified:docs/api.rst+1 added-1 removed
348 unmodified lines349 350 Flask uses ``simplejson`` for the JSON implementation. Since simplejson351 is provided both by the standard library as well as extension Flask will352 try simplejson first and then fall back to the stdlib json module. On top353-of that it will delegate access to the current application's JSOn encoders353+of that it will delegate access to the current application's JSON encoders354 and decoders for easier customization.355 356 So for starters instead of doing::357 389 unmodified linesmodified:flask/testsuite/config.py+13 added
14 unmodified lines15 import pkgutil16 import unittest17 from contextlib import contextmanager18 from flask.testsuite import FlaskTestCase19+from flask._compat import PY220 21 22 # config keys used for the ConfigTestCase23 TEST_KEY = 'foo'267 unmodified lines291 sys.path.remove(egg_path)292 if 'site_egg' in sys.modules:293 del sys.modules['site_egg']294 295+ if PY2:296+ def test_meta_path_loader_without_is_package(self):297+ class Loader(object):298+ def find_module(self, name):299+ return self300+ sys.meta_path.append(Loader())301+ try:302+ with self.assert_raises(AttributeError):303+ flask.Flask(__name__)304+ finally:305+ sys.meta_path.pop()306 307+308 def suite():309 suite = unittest.TestSuite()310 suite.addTest(unittest.makeSuite(ConfigTestCase))311 suite.addTest(unittest.makeSuite(InstanceTestCase))1 unmodified linemodified:flask/app.py+1 added-1 removed
1545 unmodified lines1546 and buffered as response object1547 :class:`tuple` A tuple in the form ``(response, status,1548 headers)`` where `response` is any of the1549 types defined here, `status` is a string1550- or an integer and `headers` is a list of1550+ or an integer and `headers` is a list or1551 a dictionary with header values.1552 ======================= ===========================================1553 1554 :param rv: the return value from the view function287 unmodified linesmodified:flask/helpers.py+7 added-2 removed
677 unmodified lines678 __import__(import_name)679 filename = sys.modules[import_name].__file__680 package_path = os.path.abspath(os.path.dirname(filename))681 # package_path ends with __init__.py for a package682+ if hasattr(loader, 'is_package'):682- if loader.is_package(root_mod_name):683- package_path = os.path.dirname(package_path)683+ if loader.is_package(root_mod_name):684+ package_path = os.path.dirname(package_path)685+ else:686+ raise AttributeError(687+ ('%s.is_package() method is missing but is '688+ 'required by Flask of PEP 302 import hooks') % loader.__class__.__name__)689 690 site_parent, site_folder = os.path.split(package_path)691 py_prefix = os.path.abspath(sys.prefix)692 if package_path.startswith(py_prefix):162 unmodified linesmodified:CHANGES+3 added
19 unmodified lines20 21 (bugfix release, release date to be announced)22 23 - Fixed broken `test_appcontext_signals()` test case.24+- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package` with a25+ useful message explaining why it is raised when a PEP 302 import hook is used26+ without an `is_package()` method.27 28 Version 0.10.129 --------------30 457 unmodified lines