Commit 21f52c30 authored by Julien Muchembled's avatar Julien Muchembled

Remove useless cast to str

parent 2876a77e
......@@ -388,7 +388,7 @@ def cmd_upload(*args):
f = nc.archive(args.url)
else:
f = urlopen(args.url)
urlmd5 = str(hashlib.md5(args.url.encode()).hexdigest())
urlmd5 = hashlib.md5(args.url.encode()).hexdigest()
nc.upload(f, args.prefix_key + urlmd5 + args.suffix_key, urlmd5=urlmd5,
file_name=os.path.basename(args.url) or "file",
**dict(x.split('=', 1) for x in args.meta))
......@@ -399,7 +399,7 @@ def cmd_download(*args):
parser = _newArgumentParser("URL of data to download.")
args = parser.parse_args(args or sys.argv[1:])
nc = NetworkcacheClient(args.config)
urlmd5 = str(hashlib.md5(args.url.encode()).hexdigest())
urlmd5 = hashlib.md5(args.url.encode()).hexdigest()
key = args.prefix_key + urlmd5 + args.suffix_key
f = sys.stdout
shutil.copyfileobj(nc.download(next(nc.select(key))['sha512']),
......
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