Skip to content

Commit

Permalink
Handle bytes in multiline values\
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Dec 23, 2015
1 parent 3aa534f commit 6b7a7b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/property_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def read_multiline_value(file, line_num, filename):
lines = [''] # We return with a beginning newline
# Re-looping over the same iterator means we don't repeat lines
for line_num, line in file:
if isinstance(line, bytes):
# Decode bytes using utf-8
line = line.decode('utf-8')
line = line.strip()
if line.endswith('"'):
lines.append(line[:-1])
Expand Down Expand Up @@ -614,6 +617,7 @@ def export(self):
for prop in self.value:
yield from prop.export()
else:
yield '"' + self.real_name + '"\n'
yield '\t{\n'
yield from (
'\t' + line
Expand Down

0 comments on commit 6b7a7b7

Please sign in to comment.