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.