diff --git a/CHANGELOG.md b/CHANGELOG.md index 650cc345..97de4d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,13 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil ### Bug Fixes -- Fixed `create_data_set` to accept "FBA", "FBM", "VBA", "VBM" as valid recfm [#240](https://github.com/zowe/zowe-client-python-sdk/issues/240) -- Fixed an issue with `list_jobs` user correlator parameter [#242](https://github.com/zowe/zowe-client-python-sdk/issues/242) -- Return response instead of raw from streamed requests [#245](https://github.com/zowe/zowe-client-python-sdk/pull/245) +- Fixed `Files.create_data_set` to accept "FBA", "FBM", "VBA", "VBM" as valid recfm [#240](https://github.com/zowe/zowe-client-python-sdk/issues/240) +- Fixed an issue with `Jobs.list_jobs` user correlator parameter [#242](https://github.com/zowe/zowe-client-python-sdk/issues/242) +- Fixed default encoding for I/O operations to be UTF-8 on Windows [#243](https://github.com/zowe/zowe-client-python-sdk/issues/243) + +### Enhancements + +- Next Breaking: Updated core SDK method `RequestHandler.perform_streamed_request` to return response object instead of raw buffer. [#245](https://github.com/zowe/zowe-client-python-sdk/pull/245) ## `1.0.0-dev12` diff --git a/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py b/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py index fa817fdb..26f49370 100644 --- a/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py +++ b/src/zos_files/zowe/zos_files_for_zowe_sdk/files.py @@ -517,7 +517,7 @@ def write_to_dsn(self, dataset_name, data, encoding=_ZOWE_FILES_DEFAULT_ENCODING def download_dsn(self, dataset_name, output_file): """Retrieve the contents of a dataset and saves it to a given file.""" raw_response = self.get_dsn_content_streamed(dataset_name) - with open(output_file, "w") as f: + with open(output_file, "w", encoding="utf-8") as f: shutil.copyfileobj(raw_response, f) def download_binary_dsn(self, dataset_name, output_file, with_prefixes=False): @@ -564,7 +564,7 @@ def write_to_uss(self, filepath_name, data, encoding=_ZOWE_FILES_DEFAULT_ENCODIN def upload_file_to_uss(self, input_file, filepath_name, encoding=_ZOWE_FILES_DEFAULT_ENCODING): """Upload contents of a given file and uploads it to UNIX file""" if os.path.isfile(input_file): - in_file = open(input_file, "r") + in_file = open(input_file, "r", encoding="utf-8") file_contents = in_file.read() response_json = self.write_to_uss(filepath_name, file_contents) else: diff --git a/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py b/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py index f3f21510..4f497ce9 100644 --- a/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py +++ b/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py @@ -267,7 +267,7 @@ def submit_from_local_file(self, jcl_path): A JSON containing the result of the request execution """ if os.path.isfile(jcl_path): - jcl_file = open(jcl_path, "r") + jcl_file = open(jcl_path, "r", encoding="utf-8") file_content = jcl_file.read() jcl_file.close() return self.submit_plaintext(file_content) @@ -397,7 +397,7 @@ def get_job_output_as_files(self, status, output_dir): _output_file = os.path.join(output_dir, _job_name, _job_id, "jcl.txt") _data_spool_file = self.get_jcl_text(_job_correlator) _dataset_content = _data_spool_file["response"] - _out_file = open(_output_file, "w") + _out_file = open(_output_file, "w", encoding="utf-8") _out_file.write(_dataset_content) _out_file.close() @@ -412,7 +412,7 @@ def get_job_output_as_files(self, status, output_dir): _output_file = os.path.join(output_dir, _job_name, _job_id, _stepname, _ddname) _data_spool_file = self.get_spool_file_contents(_job_correlator, _spoolfile_id) _dataset_content = _data_spool_file["response"] - _out_file = open(_output_file, "w") + _out_file = open(_output_file, "w", encoding="utf-8") _out_file.write(_dataset_content) _out_file.close()