-
Notifications
You must be signed in to change notification settings - Fork 675
Closed
Labels
Description
When using the @ prefix to specify a file that should be read, it will read the file as "utf-8" text. This fails with binary files such as a PNG.
This was discussed in #2751 as pointed out by @trafford-tbe
Code is:
Lines 299 to 307 in d7bdb02
| if isinstance(v, str) and v.startswith("@"): | |
| # If the user-provided value starts with @, we try to read the file | |
| # path provided after @ as the real value. Exit on any error. | |
| try: | |
| with open(v[1:], encoding="utf-8") as f: | |
| return f.read() | |
| except Exception as e: | |
| sys.stderr.write(f"{e}\n") | |
| sys.exit(1) |