We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1e08f70 + b15a50a commit d02204aCopy full SHA for d02204a
apache_log_parser/__init__.py
@@ -1,5 +1,6 @@
1
import re
2
from datetime import datetime, tzinfo, timedelta
3
+import sys
4
5
import user_agents
6
@@ -220,6 +221,8 @@ def __init__(self, format_string):
220
221
self.names = tuple(self.names)
222
223
def parse(self, log_line):
224
+ if (sys.version_info.major > 2):
225
+ log_line = log_line.decode('utf-8')
226
match = self.log_line_regex.match(log_line)
227
if match is None:
228
raise LineDoesntMatchException(log_line=log_line, regex=self.log_line_regex.pattern)
0 commit comments