Skip to content

Commit 0bcbed7

Browse files
committed
Make sure to check whether a unicode string is passed in before converting
1 parent d8a0b15 commit 0bcbed7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

logentries/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '1.0'
1+
VERSION = '2.0.1'
22

33
import logging
44
import Queue
@@ -81,7 +81,10 @@ def run(self):
8181
data = self._queue.get(block=True)
8282

8383
# Replace newlines with Unicode line separator for multi-line events
84-
multiline = unicode(data, "utf-8").replace('\n', '\u2028')
84+
if not isinstance(data, unicode):
85+
multiline = unicode(data, "utf-8").replace('\n', '\u2028')
86+
else:
87+
multiline = data.replace('\n', '\u2028')
8588
multiline += "\n"
8689
# Send data, reconnect if needed
8790
while True:

0 commit comments

Comments
 (0)