Skip to content

strconf: Fix unquote to handle \a \b \v \f

Kirill Smelkov requested to merge kirr/pygolang:y/unquote-abvf into master

Those are quote codes that Go strconv.Quote might produce. And even though Python does not use them when quoting, it too handles those quote codes when decoding:

In [1]: '\r'
Out[1]: '\r'

In [2]: '\a\b\v\f'
Out[2]: '\x07\x08\x0b\x0c'

https://github.com/python/cpython/blob/2.7.18-0-g8d21aa21f2c/Objects/stringobject.c#L677-L688

-> Teach strconv.unquote + friends to handle them as well.

Merge request reports