Gitlab Community Edition Instance

Commit c3054b94 authored by Marcel Hellkamp's avatar Marcel Hellkamp
Browse files

fix: Fail if put_file() is called with a path string instead of a file-like

parent 6d743fb1
......@@ -156,6 +156,8 @@ class CDStar:
break
def put_file(self, vault, archive, name, source, type=None):
if not hasattr(source, "read"):
raise ValueError("Source must be a file-like object")
return self._rest("PUT", vault, archive, _fix_filename(name), data=source,
headers={'Content-Type': type or "application/x-autodetect"}).json()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment