Invalid string escapes #2280

nascheme opened this Issue Dec 8, 2016 · 6 comments


None yet

3 participants

nascheme commented Dec 8, 2016

There are a couple of invalid string/byte escapes left in the code (Python 3.6 warn about them)::

./PIL/ bad string escape 'if re.match(b"\w+:|#", s):'
./PIL/ bad string escape 'is_cid = re.compile(b"\w\w\w\w").match'
./PIL/ bad string escape 'b"\s*#define[ \t]+.*_width[ \t]+(?P[0-9]+)[\r\n]+"'
./winbuild/ bad string escape '""" + "\n".join('set %s=%%BUILD%%\%s' % (k.upper(), v['dir'])'
./winbuild/ bad string escape 'ret.append("%s%s%s\Scripts\pip.exe install nose" %'
./winbuild/ bad string escape 'ret.append("%s%s%s\Scripts\pip.exe install unittest2" %'

hugovk commented Dec 9, 2016

@nascheme What do you run on Python 3.6 to get these warnings?

nascheme commented Dec 9, 2016

It is a little script I wrote:
I think ideally we would have a 2to3 like tool that just fixed the source code in-place.

hugovk commented Dec 13, 2016

Looks like the PIL/ trio were fixed in PR #2186, and the one was removed by PR #2243, leaving:

./winbuild/ bad string escape '""" + "\n".join('set %s=%%BUILD%%%s' % (k.upper(), v['dir'])'
./winbuild/ bad string escape 'ret.append("%s%s%s\Scripts\pip.exe install nose" %'


Is this one fixed then?

@aclark4life aclark4life added the Bug label Jan 8, 2017

Just the winbuild scripts are left to fix. This patch (untested) should fix them.


hugovk commented Jan 12, 2017

PR: #2352.

@wiredfool wiredfool closed this in #2352 Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment