Commit 21f52c30 by Julien Muchembled

Remove useless cast to str

1 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']),
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!