python: use raw string for regex with escape
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 6 Feb 2020 22:25:27 +0000 (11:25 +1300)
committerNoel Power <npower@samba.org>
Fri, 7 Feb 2020 10:37:37 +0000 (10:37 +0000)
commit07fa6678e43aa899472ac7c4f61960fabd326531
tree84ddf92f4baa2173bee5e7688605023fdf13b2b8
parentc247afbda00013bf4821e5a2d4f3166bf31814f0
python: use raw string for regex with escape

Python regards 'GPT\.INI$' as a string containing an invalid escape
sequence '\.', which is ignored (i.e. treated as the literal sequence
of those 2 characters), but only after Python has grumbled to itself,
and to you if you enabled DeprecationWarnings.

The proper thing to do here is use r-strings, like r'GPT\.INI$', which
tell Python that all backslashes are literal. Alternatively (as we do
once in this patch), the backslash can itself be escaped ('\\').

There are more problems of this nature in the build scripts.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
python/samba/gp_parse/gp_inf.py
python/samba/netcmd/drs.py
python/samba/netcmd/dsacl.py
python/samba/netcmd/gpo.py
python/samba/netcmd/ldapcmp.py