Skip to content

Commit 9eabc7a

Browse files
committed
Fix encoding issue of job metadata in on_job_done #657
1 parent 623bcfe commit 9eabc7a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
### Fixed
1919

2020
- `MultiBackendJobManager`: Fix issue with duplicate job starting across multiple backends ([#654](https://github.com/Open-EO/openeo-python-client/pull/654))
21+
- `MultiBackendJobManager`: Fix encoding issue of job metadata in `on_job_done` ([#657](https://github.com/Open-EO/openeo-python-client/issues/657))
2122

2223

2324
## [0.34.0] - 2024-10-31

openeo/extra/job_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def on_job_done(self, job: BatchJob, row):
596596
self.ensure_job_dir_exists(job.job_id)
597597
job.get_results().download_files(target=job_dir)
598598

599-
with open(metadata_path, "w") as f:
599+
with metadata_path.open("w", encoding="utf-8") as f:
600600
json.dump(job_metadata, f, ensure_ascii=False)
601601

602602
def on_job_error(self, job: BatchJob, row):

openeo/udf/xarraydatacube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def to_json_file(cls, array: xarray.DataArray, path: Union[str, Path]):
345345
jsonarray['coords'][i.name]['attrs']['shape'] = list(i.shape)
346346
# custom print so resulting json file is humanly easy to read
347347
# TODO: make this human friendly JSON format optional and allow compact JSON too.
348-
with Path(path).open("w") as f:
348+
with Path(path).open("w", encoding="utf-8") as f:
349349
def custom_print(data_structure, indent=1):
350350
f.write("{\n")
351351
needs_comma = False

0 commit comments

Comments
 (0)