Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/generate_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def populate_xml(datatype: str, id: int, filepath: str, conn: BlitzGateway,
if (not (barchive or simple)) and figure:
populate_figures(ome, conn, filepath)
if not barchive:
with open(filepath, 'w') as fp:
with open(filepath, 'w', encoding='utf-8') as fp:
print(to_xml(ome), file=fp)
fp.close()
path_id_dict = list_file_ids(ome)
Expand All @@ -1009,7 +1009,7 @@ def populate_xml_folder(folder: str, filelist: bool) -> Tuple[OME, dict]:
filepath = str(Path(folder) / "transfer.xml")
else:
raise ValueError("Folder cannot be found!")
with open(filepath, 'w') as fp:
with open(filepath, 'w', encoding='utf-8') as fp:
print(to_xml(ome), file=fp)
fp.close()
path_id_dict = list_file_ids(ome)
Expand All @@ -1022,7 +1022,7 @@ def populate_tsv(datatype: str, ome: OME, filepath: str,
logger.warning("Bioimage Archive export of Plate/Screen"
" currently unsupported")
return
with open(filepath, 'w') as fp:
with open(filepath, 'w', encoding='utf-8', newline='') as fp:
write_lines(datatype, ome, fp, path_id_dict, folder)
fp.close()
return
Expand Down
4 changes: 2 additions & 2 deletions src/omero_cli_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def _fix_pixels_image_simple(self, ome: OME, folder: str, filepath: str
os.path.join(str(Path(folder)), path2))
if os.path.exists(os.path.join(str(Path(folder)), "pixel_images")):
shutil.rmtree(os.path.join(str(Path(folder)), "pixel_images"))
with open(filepath, 'w') as fp:
with open(filepath, 'w', encoding='utf-8') as fp:
print(to_xml(newome), file=fp)
fp.close()
return newome
Expand Down Expand Up @@ -563,7 +563,7 @@ def __pack(self, args):
path_id_dict.update(this_id_dict)
# need to somehow merge omes/path_id_dicts
if not args.barchive:
with open(md_fp, 'w') as fp:
with open(md_fp, 'w', encoding='utf-8') as fp:
print(to_xml(ome), file=fp)
fp.close()
if args.binaries == "all":
Expand Down
Loading