Skip to content

Commit

Permalink
fix: Encoded special characters properly when reading JSON strings
Browse files Browse the repository at this point in the history
  • Loading branch information
davidandreoletti committed Jan 23, 2024
1 parent 733b50d commit 8441cec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pass_import/managers/onepassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def pif2json(file):
cleaned = [v for v in cleaned if len(v) > 0]
cleaned = ','.join(cleaned).rstrip(',')
cleaned = f'[{cleaned}]'
# JSON string with eventual special characters are encoded properly
# eg: NUL, TAB
cleaned = json.dumps(json.loads(cleaned, strict=False))
return json.loads(cleaned)

def parse(self):
Expand Down

0 comments on commit 8441cec

Please sign in to comment.