소스 검색

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

transfer: fix user/group == None crash with borg1 archives
TW 2 년 전
부모
커밋
f2fe22522d
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/borg/item.pyx

+ 4 - 0
src/borg/item.pyx

@@ -365,6 +365,10 @@ class Item(PropDict):
         # also need to fix old timestamp data types.
         for k, v in list(d.items()):
             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'):
                 v = fix_str_value(d, k)
             if k in ('chunks', 'chunks_healthy'):