Skip to content
Myr

Merge branch '0.10-maintenance'

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 63d9ede, 58ad83f · Browse files · 3 files+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+11 added−0 removed

  • other:+11 added−0 removed

3 files+11 added−0 removed

modified:flask/testsuite/basic.py+3 added
324 unmodified lines
325 def modify_session(response):326 flask.session['m'] = flask.Markup('Hello!')327 flask.session['u'] = the_uuid328 flask.session['dt'] = now329 flask.session['b'] = b'\xff'330 flask.session['t'] = (1, 2, 3)331 return response332333 @app.route('/')
6 unmodified lines
340 self.assert_equal(rv['m'], flask.Markup('Hello!'))341 self.assert_equal(type(rv['m']), flask.Markup)342 self.assert_equal(rv['dt'], now)343 self.assert_equal(rv['u'], the_uuid)344 self.assert_equal(rv['b'], b'\xff')345 self.assert_equal(type(rv['b']), bytes)346 self.assert_equal(rv['t'], (1, 2, 3))347348 def test_flashes(self):349 app = flask.Flask(__name__)
876 unmodified lines
modified:flask/sessions.py+5 added
9 unmodified lines
10"""1112import uuid13import hashlib14from base64 import b64encode, b64decode15from datetime import datetime16from werkzeug.http import http_date, parse_date17from werkzeug.datastructures import CallbackDict18from . import Markup, json
43 unmodified lines
62 if isinstance(value, tuple):63 return {' t': [_tag(x) for x in value]}64 elif isinstance(value, uuid.UUID):65 return {' u': value.hex}66 elif isinstance(value, bytes):67 return {' b': b64encode(value).decode('ascii')}68 elif callable(getattr(value, '__html__', None)):69 return {' m': text_type(value.__html__())}70 elif isinstance(value, list):71 return [_tag(x) for x in value]
20 unmodified lines
92 if the_key == ' t':93 return tuple(the_value)94 elif the_key == ' u':95 return uuid.UUID(the_value)96 elif the_key == ' b':97 return b64decode(the_value)98 elif the_key == ' m':99 return Markup(the_value)100 elif the_key == ' d':101 return parse_date(the_value)
231 unmodified lines
modified:CHANGES+3 added
10 unmodified lines
11- Fixed an issue where ``|tojson`` was not quoting single quotes which12 made the filter not work properly in HTML attributes. Now it's13 possible to use that filter in single quoted attributes. This should14 make using that filter with angular.js easier.15- Added support for byte strings back to the session system. This broke16 compatibility with the common case of people putting binary data for17 token verification into the session.1819Version 0.1020------------21
442 unmodified lines