0

I have issues with an python script. When I run it I has this error:

 ./ics2owncloud.py
  File "./ics2owncloud.py", line 46
    if r.status_code == 500 and 'Sabre\VObject\Recur\NoInstancesException' in r.text:
                                   ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 19-20: malformed \N character escape

This is the script: https://github.com/buzz/ics2owncloud.py

I used python3 not 2.7 at the original script.

John1024
  • 109,961
  • 14
  • 137
  • 171
Lars
  • 31
  • 1
  • 3
  • 5

1 Answers1

1

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.

cxw
  • 16,685
  • 2
  • 45
  • 81