dateutils icon indicating copy to clipboard operation
dateutils copied to clipboard

Exit status of strptime in case of error is 0

Open csadam opened this issue 6 years ago • 1 comments

I'm running the following on Ubuntu 18 Package: dateutils Version: 0.4.2-1

ubuntu@testy:~$ dateutils.strptime -i '%d/%m/%Y %H:%M:%S' 'no date here'
strptime: cannot make sense of `no date here' using the given input formats
ubuntu@testy:~$ echo $?
0

The exit code of the dateutils.strptime is 0 if it can't parse the input.

Is it intentional? I'm expecting a non-zero exit status to catch the error in my scripts.

csadam avatar May 09 '19 21:05 csadam

Hey there, thank you for your report. Indeed this was an oversight. It should be fixed in 22cd659d3.

hroptatyr avatar May 10 '19 07:05 hroptatyr