File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,8 +58,15 @@ def process_config(
5858 read_file_partial = partial (read_file , config ["$source" ])
5959 read_file_partial .__name__ = read_file .__name__ # type: ignore
6060
61- with open (config ["$source" ]) as stream :
62- processed_file = service .process_vars_for (stream .read (), [read_file_partial ])
61+ with open (config ["$source" ], encoding = "utf-8" ) as stream :
62+ try :
63+ processed_file = service .process_vars_for (stream .read (), [read_file_partial ])
64+ except UnicodeDecodeError as ex :
65+ raise ValueError (
66+ f"Configuration file { config ['$source' ]} , specified by { config ['from' ]} in service { service ['$name' ]} "
67+ f"is not a valid UTF-8 encoded text files. `config' files must be valid UTF-8 encoded text files. "
68+ f"For other files consider using `additional_volumes`."
69+ ) from ex
6370
6471 if is_in_source_path :
6572 notice_file = target_file + ".riptide_info.txt"
You can’t perform that action at this time.
0 commit comments