From 1bd681193feef31d032c13e7022bc2d65d9e0a21 Mon Sep 17 00:00:00 2001 From: Jeremy Chen Date: Mon, 10 Apr 2017 14:55:46 +1000 Subject: replace deprecated cgi.escape() with html.escape() As suggested by https://docs.python.org/3.6/library/cgi.html cgi.escape() Deprecated since version 3.2: This function is unsafe because quote is false by default, and therefore deprecated. Use html.escape() instead. --- docs/tutorials/wiki2/src/views/tutorial/views/default.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/tutorials/wiki2/src/views') diff --git a/docs/tutorials/wiki2/src/views/tutorial/views/default.py b/docs/tutorials/wiki2/src/views/tutorial/views/default.py index bb6300b75..0a05b33e6 100644 --- a/docs/tutorials/wiki2/src/views/tutorial/views/default.py +++ b/docs/tutorials/wiki2/src/views/tutorial/views/default.py @@ -1,4 +1,4 @@ -import cgi +import html import re from docutils.core import publish_parts @@ -31,10 +31,10 @@ def view_page(request): exists = request.dbsession.query(Page).filter_by(name=word).all() if exists: view_url = request.route_url('view_page', pagename=word) - return '%s' % (view_url, cgi.escape(word)) + return '%s' % (view_url, html.escape(word)) else: add_url = request.route_url('add_page', pagename=word) - return '%s' % (add_url, cgi.escape(word)) + return '%s' % (add_url, html.escape(word)) content = publish_parts(page.data, writer_name='html')['html_body'] content = wikiwords.sub(add_link, content) -- cgit v1.2.3