2
0
Эх сурвалжийг харах

Merge pull request #7052 from ThomasWaldmann/fix-upgrader-user-group-none

transfer: fix user/group == None crash with borg1 archives
TW 2 жил өмнө
parent
commit
f2fe22522d

+ 4 - 0
src/borg/item.pyx

@@ -365,6 +365,10 @@ class Item(PropDict):
         # also need to fix old timestamp data types.
         # also need to fix old timestamp data types.
         for k, v in list(d.items()):
         for k, v in list(d.items()):
             k = fix_key(d, k)
             k = fix_key(d, k)
+            if k in ('user', 'group') and d[k] is None:
+                # borg 1 stored some "not known" values with a None value.
+                # borg 2 policy for such cases is to just not have the key/value pair.
+                continue
             if k in ('path', 'source', 'user', 'group'):
             if k in ('path', 'source', 'user', 'group'):
                 v = fix_str_value(d, k)
                 v = fix_str_value(d, k)
             if k in ('chunks', 'chunks_healthy'):
             if k in ('chunks', 'chunks_healthy'):