diff --git a/dcicutils/tmpfile_utils.py b/dcicutils/tmpfile_utils.py index ba1652cb6..f96ec4ef1 100644 --- a/dcicutils/tmpfile_utils.py +++ b/dcicutils/tmpfile_utils.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 250bdfa64..3f9febe0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "MIT"