summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Brox <tobias@redpill-linpro.com>2022-01-07 17:04:49 +0100
committerTobias Brox <tobias@redpill-linpro.com>2022-01-07 22:22:57 +0100
commitc7df6959164748baa641f93a45b15d9dcba13500 (patch)
treeda12e31f43d9ab3811a897fd96485036edacd41b
parentf1c234e86f4c866b10b00e7440084cc542838414 (diff)
downloadpython-caldav-c7df6959164748baa641f93a45b15d9dcba13500.zip
bugfix: to_wire should also return an empty byte string if given an empty unicode string
-rw-r--r--caldav/lib/python_utilities.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/caldav/lib/python_utilities.py b/caldav/lib/python_utilities.py
index f0c3ef8..f5ee422 100644
--- a/caldav/lib/python_utilities.py
+++ b/caldav/lib/python_utilities.py
@@ -7,7 +7,7 @@ def isPython3():
def to_wire(text):
- if text and isinstance(text, string_types) and PY3:
+ if text is not None and isinstance(text, string_types) and PY3:
text = bytes(text, 'utf-8')
elif not PY3:
text = to_unicode(text).encode('utf-8')