Skip to content

Commit fccf82c

Browse files
authored
Merge pull request #16 from seiflotfy/unquote
we need to double unquote to deal with '~'
2 parents a3a1c9d + d77b944 commit fccf82c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def lambda_handler(event, context=None):
137137
decompressed_body = fetch_s3_object(bucket, key)
138138

139139
# parse TSV
140-
lines = str(decompressed_body, "utf-8").split("\n")
140+
lines = unquote(unquote(str(decompressed_body, "utf-8"))).split("\n")
141141
columns = []
142142
for line in lines:
143143
if line.startswith(fields_prefix):
@@ -146,7 +146,7 @@ def lambda_handler(event, context=None):
146146
elif line.startswith("#"):
147147
continue
148148

149-
values = unquote(line).split("\t")
149+
values = line.split("\t")
150150
ev = log_to_event(dict(zip(columns, values)))
151151
if ev is not None:
152152
ev["_log_source"] = key

0 commit comments

Comments
 (0)