Skip to content

Commit

Permalink
encoding only on "w"
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdecker1201 committed Feb 9, 2023
1 parent 8458308 commit 935f24c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spdx/writers/write_anything.py
Expand Up @@ -21,8 +21,9 @@
def write_file(doc, fn, validate=True, encoding="utf-8"):
out_mode = "w"
if fn.endswith(".rdf") or fn.endswith(".rdf.xml"):
writer_module = rdf
out_mode = "wb"
with open(fn, "wb") as out:
p = rdf.write_document(doc, out, validate)
return
elif fn.endswith(".tag") or fn.endswith(".spdx"):
writer_module = tagvalue
elif fn.endswith(".json"):
Expand Down

0 comments on commit 935f24c

Please sign in to comment.