From 13b18a91181361349da81c16224d239ce77ca465 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 9 Jun 2022 11:50:16 +0530 Subject: [PATCH] fix: Regex compilation in boilerplate utils Flagged via tests in frappe.tests.test_boilerplate --- frappe/utils/boilerplate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/utils/boilerplate.py b/frappe/utils/boilerplate.py index 05a227fb5e..28eefd0085 100644 --- a/frappe/utils/boilerplate.py +++ b/frappe/utils/boilerplate.py @@ -11,7 +11,7 @@ import git import frappe from frappe.utils import touch_file -APP_TITLE_PATTERN = re.compile(r"^(?![\W])[^\d_\s][\w -]+$") +APP_TITLE_PATTERN = re.compile(r"^(?![\W])[^\d_\s][\w -]+$", flags=re.UNICODE) def make_boilerplate(dest, app_name, no_git=False): @@ -69,7 +69,7 @@ def _get_user_inputs(app_name): def is_valid_title(title) -> bool: - if not APP_TITLE_PATTERN.match(title, re.UNICODE): + if not APP_TITLE_PATTERN.match(title): print( "App Title should start with a letter and it can only consist of letters, numbers, spaces and underscores" )