[docs] [BUG REPORT 2.7.10] ValueError: invalid \x escape

Zachary Ware zachary.ware+pydocs at gmail.com
Fri Sep 11 17:49:35 CEST 2015


Hi,

On Wed, Sep 9, 2015 at 2:08 AM, Guillaume ALLARD
<allardguillaume at orange.fr> wrote:
> Hello,
>
> Python 2.7.10, Windows 7
>
> "ValueError: invalid \x escape"
>
> Note that there is no indication of where is the error (no line number).
>
>
> the faulty ligne is a # commented line inside a """ commented block.
>
> """
> . . .
>         #s.send("PRIVMSG bot :!voice %s\x\n" % n)
> . . .
> """
>
> changing "\x" to "\x12" (for example) fixes the error.

This is not a bug.  Triple-quoted strings are strings, not comments,
and the '#' character in a string is just a '#', not a comment marker.

Also, for future reference, this is not the correct list for reporting
bugs (other than documentation bugs); see bugs.python.org for the
Python bug tracker.

Hope this helps,
-- 
Zach


More information about the docs mailing list