- Notifications
You must be signed in to change notification settings - Fork674
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 ind7bdb02
| ifisinstance(v,str)andv.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: | |
| withopen(v[1:],encoding="utf-8")asf: | |
| returnf.read() | |
| exceptExceptionase: | |
| sys.stderr.write(f"{e}\n") | |
| sys.exit(1) |