From f4216ebb4097af71fc9477cd097360e08117d265 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 21 Feb 2012 21:46:48 +0200 Subject: Fix favicon_view example: open the file in binary mode. Without this fix Python 3 users might get Unicode errors, and Windows users might get data corruption. --- docs/narr/assets.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index 4f80d33c7..2cc870619 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -374,7 +374,7 @@ do so, do things "by hand". First define the view callable. def favicon_view(request): here = os.path.dirname(__file__) - icon = open(os.path.join(here, 'static', 'favicon.ico')) + icon = open(os.path.join(here, 'static', 'favicon.ico'), 'rb') return Response(content_type='image/x-icon', app_iter=icon) The above bit of code within ``favicon_view`` computes "here", which is a -- cgit v1.2.3