]> arthur.barton.de Git - bup.git/commit
Reject invalid string in --date argument
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 23 Apr 2015 20:41:45 +0000 (22:41 +0200)
committerRob Browning <rlb@defaultvalue.org>
Fri, 24 Apr 2015 00:47:33 +0000 (19:47 -0500)
commit297783db951ee550de79901b4ed6c29735061541
tree7fdc8d839bf8b98aad2563b13208f2e8582dc372
parent6e2080a451a070bf34bd6b86071f6014ba584d15
Reject invalid string in --date argument

As parse_date_or_fatal() currently uses atof(), which just returns 0
if the string isn't a valid number, it can never actually be fatal
and will just use "1970-01-01 00:00:00" as the time if the string is
specified wrong.

Fix that by using float() directly so ValueError() is raised.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
[rlb@defaultvalue.org: adjust commit summary]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py