Try changing all of the \
to \\
, or put an r
in front of the string, e.g.,
if r.status_code == 500 and r'Sabre\VObject\Recur\NoInstancesException' in r.text:
# ^ that right there
In general, though, running Python 2.7 code with Python 3 (or vice versa) will almost certainly not work! They are not directly compatible. Stick with 2.7 if that's what your scripts were written for.
In the meantime, welcome to the site! Check out the Stack Overflow tour for more on asking questions that will attract quality answers.