[issue37106] python re.escape doesn't escape some special characters.

2019-05-31 Thread Eric V. Smith
Eric V. Smith added the comment: re.escape() is designed to only escape characters that have special meaning in regular expressions. It is not a general purpose escaping mechanism, and it is especially dangerous to use it for building SQL statements. You should be using parameterized SQL que

[issue37106] python re.escape doesn't escape some special characters.

2019-05-31 Thread MANI M
MANI M added the comment: sorry my bad query = "insert into table(column) values('{}')".format(escape("Hello'`~world")) -- ___ Python tracker ___ ___

[issue37106] python re.escape doesn't escape some special characters.

2019-05-31 Thread MANI M
MANI M added the comment: I've scripts which insert data into MySQL database. The values may contain symbols. Hence in order to escape that I use re.escape(). @erik.smith isn't re.escape() supposed to escape all the symbols. If not why is this introduced in 3.7 whereas previous versions beha

[issue37106] python re.escape doesn't escape some special characters.

2019-05-31 Thread Eric V. Smith
Eric V. Smith added the comment: Could you show a problem caused by the characters that are unescaped? I assume you're talking about the ` and ' characters, since that's what your example shows. But those aren't listed as "special characters" (https://docs.python.org/3.5/library/re.html#regu

[issue37106] python re.escape doesn't escape some special characters.

2019-05-30 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: It's a behavior change from 3.6 and it's present from 3.7.0a1 -- ___ Python tracker ___ ___

[issue37106] python re.escape doesn't escape some special characters.

2019-05-30 Thread MANI M
MANI M added the comment: Thanks a lot for the info. May I know in what version of python the patches are applied? Because still 3.7.3 seems to have the issue. -- ___ Python tracker

[issue37106] python re.escape doesn't escape some special characters.

2019-05-30 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Please consider posting text content instead of images for better accessibility. This could be due to issue29995. ➜ cpython git:(master) python3.6 Python 3.6.4 (default, Mar 12 2018, 13:42:53) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]

[issue37106] python re.escape doesn't escape some special characters.

2019-05-30 Thread MANI M
New submission from MANI M : Recently I figured out an issue in python3 re which doesn't escape some special characters. Not sure whether this bug has been reported already. Have attached screenshots for your reference. Steps to reproduce: 1. wget https://www.python.org/ftp/python/3.7.3/Python