force max_volume_size >= RECORDSIZE since last volume is filled with 0s until RECORDSIZE
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 15 Jul 2016 10:42:06 +0000 (12:42 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 11 Nov 2020 12:18:34 +0000 (13:18 +0100)
deltatar/tarfile.py

index 6deff35..5497de6 100644 (file)
@@ -2077,8 +2077,9 @@ class TarFile(object):
             self.errorlevel = errorlevel
 
         # Init datastructures.
-        if max_volume_size and max_volume_size < 3*BLOCKSIZE:
-            raise ValueError("max_volume_size needs to be at least %d" % (3*BLOCKSIZE))
+        if max_volume_size and max_volume_size < RECORDSIZE:
+            raise ValueError("max_volume_size needs to be at least RECORDSIZE "
+                             "({})".format(RECORDSIZE))
         if max_volume_size and not callable(new_volume_handler):
             raise ValueError("new_volume_handler needs to be set and be callable for multivolume support")
         if max_volume_size: