diff --git a/frappe/installer.py b/frappe/installer.py index 62b870bb9f..5b36c3b41b 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -6,6 +6,8 @@ from __future__ import unicode_literals, print_function +import six + import os, json, sys, subprocess, shutil import frappe import frappe.database @@ -178,7 +180,7 @@ def remove_app(app_name, dry_run=False, yes=False): """Delete app and all linked to the app's module with the app.""" if not dry_run and not yes: - confirm = input("All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue (y/n) ? ") + confirm = six.input("All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue (y/n) ? ") if confirm!="y": return @@ -302,7 +304,7 @@ def get_site_config_path(): def get_conf_params(db_name=None, db_password=None): if not db_name: - db_name = input("Database Name: ") + db_name = six.input("Database Name: ") if not db_name: raise Exception("Database Name Required") diff --git a/frappe/utils/boilerplate.py b/frappe/utils/boilerplate.py index de1fc421cf..8dccd414a6 100755 --- a/frappe/utils/boilerplate.py +++ b/frappe/utils/boilerplate.py @@ -3,6 +3,8 @@ from __future__ import unicode_literals, print_function +import six + import frappe, os, re from frappe.utils import touch_file, encode, cstr @@ -25,7 +27,7 @@ def make_boilerplate(dest, app_name): hook_key = key.split(" (")[0].lower().replace(" ", "_") hook_val = None while not hook_val: - hook_val = cstr(input(key + ": ")) + hook_val = cstr(six.input(key + ": ")) if not hook_val: defaults = { diff --git a/frappe/website/render.py b/frappe/website/render.py index e812991805..33163e6aa9 100644 --- a/frappe/website/render.py +++ b/frappe/website/render.py @@ -111,7 +111,7 @@ def build_response(path, data, http_status_code, headers=None): if headers: for key, val in iteritems(headers): - response.headers[bytes(key)] = val.encode("utf-8") + response.headers[bytes(key.encode("utf-8"))] = val.encode("utf-8") return response