Skip to content

Commit

Permalink
fix to tmpfile_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Jan 9, 2024
1 parent 1078685 commit 0ef2f6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dcicutils/tmpfile_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def temporary_file(name: Optional[str] = None, suffix: Optional[str] = None,
content: Optional[Union[str, bytes, List[str]]] = None) -> str:
with temporary_directory() as tmp_directory_name:
tmp_file_name = os.path.join(tmp_directory_name, name or tempfile.mktemp(dir="")) + (suffix or "")
if content is not None:
with open(tmp_file_name, "wb" if isinstance(content, bytes) else "w") as tmp_file:
with open(tmp_file_name, "wb" if isinstance(content, bytes) else "w") as tmp_file:
if content is not None:
tmp_file.write("\n".join(content) if isinstance(content, list) else content)
yield tmp_file_name

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicutils"
version = "8.7.0.1b21" # TODO: To become 8.7.1
version = "8.7.0.1b22" # TODO: To become 8.7.1
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 0ef2f6f

Please sign in to comment.