mirror of https://github.com/borgbase/vorta
Bugfix for handling 0 byte modification in diff view (#356)
An exception was thrown when diff of two archives were requested. The exception was ''' vorta/views/diff_result.py", line 52, in parse_line size = int(size) ValueError: invalid literal for int() with base 10: '' ''' which was caused by diff line: ''' 0 B -2.6 kB home/philroche/.config/google-chrome/Profile 1/QuotaManager-journal ''' This commit fixes the issue by only stripping +/- from string if they exist. * Remove trailing whitespace causing flake8 failures
This commit is contained in:
parent
f103d78af1
commit
6c69f3689e
|
@ -40,9 +40,11 @@ class DiffResult(DiffResultBase, DiffResultUI):
|
|||
unit = line_splitted[2]
|
||||
else:
|
||||
change_type = "modified"
|
||||
# Remove '+' or '-' sign at the front
|
||||
size = line_splitted[0][1:]
|
||||
size = line_splitted[0]
|
||||
unit = line_splitted[1]
|
||||
# If present remove '+' or '-' sign at the front
|
||||
if '+' in size or '-' in size:
|
||||
size = size[1:]
|
||||
|
||||
if line_splitted[0].startswith("["):
|
||||
size = 0
|
||||
|
|
Loading…
Reference in New Issue