MANI M <maannn...@gmail.com> 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 behave differently.

Example snippet:

import pymysql
from re import escape
def db_connection():
    ......
    ......
    ......

    # This throws error.
    query = " insert into table(column) 
values('{}'.format(escape("Hello'`~world")))

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37106>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to