summaryrefslogtreecommitdiff
path: root/calendar-cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'calendar-cli.py')
-rwxr-xr-xcalendar-cli.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index 1b531db..6955704 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -162,6 +162,9 @@ def _calendar_addics(caldav_conn, ics, uid, args):
try:
c = find_calendar(caldav_conn, args)
+ ## unicode strings vs byte strings is a minefield in python3 ... so, re.search demands a string here ...
+ if hasattr(ics, 'decode'):
+ ics = ics.decode('utf-8')
if re.search(r'^METHOD:[A-Z]+[\r\n]+',ics,flags=re.MULTILINE) and args.ignoremethod:
ics = re.sub(r'^METHOD:[A-Z]+[\r\n]+', '', ics, flags=re.MULTILINE)
print ("METHOD property found and ignored")