Perform user expansion when uploading files from the CLI.
Don't ignore missing files - allow an exception to be raised. Add extra CLI file upload unit tests.
This commit is contained in:
parent
4deceb6e8e
commit
b7fe17656b
2 changed files with 32 additions and 3 deletions
|
@ -122,9 +122,8 @@ def extract_files(params):
|
|||
files = {}
|
||||
updated_params = {}
|
||||
for name in params:
|
||||
if (name == "photo" and params[name].startswith("@") and
|
||||
os.path.isfile(os.path.expanduser(params[name][1:]))):
|
||||
files[name] = open(params[name][1:], 'rb')
|
||||
if name == "photo" and params[name].startswith("@"):
|
||||
files[name] = open(os.path.expanduser(params[name][1:]), 'rb')
|
||||
else:
|
||||
updated_params[name] = params[name]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue