From 402d87c75781bc56fb915e3bb0ed40f71c0364f2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 18 Nov 2012 11:42:18 +0000 Subject: [PATCH] Stop loss of precision when writing 'x-object-meta-mtime' str(float) isn't a good way of converting a float to a string with all the precision Eg >>> f = os.path.getmtime("z") >>> f 1347717491.343554 >>> str(f) '1347717491.34' >>> "%f" % f '1347717491.343554' Change-Id: I6eb02f7f6730eff814c348d1039eae4606642b52 --- bin/swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/swift b/bin/swift index 5335bd3..53b6b68 100755 --- a/bin/swift +++ b/bin/swift @@ -807,7 +807,7 @@ def st_upload(parser, args, print_queue, error_queue): obj = obj[2:] if obj.startswith('/'): obj = obj[1:] - put_headers = {'x-object-meta-mtime': str(getmtime(path))} + put_headers = {'x-object-meta-mtime': "%f" % getmtime(path)} if dir_marker: if options.changed: try: