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:
|
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) |
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:
python-gitlab/gitlab/cli.py
Lines 299 to 307 in d7bdb02