diff --git a/setup.py b/setup.py index b6aadf288..dd85db6a1 100644 --- a/setup.py +++ b/setup.py @@ -368,12 +368,12 @@ class build_usage(Command): # "+ 1" because we want a space between the cell contents and the delimiting "|" in the output column_widths[i] = max(column_widths[i], len(cells[i]) + 1) - for columns, *cells in rows: + for columns, *original_cells in rows: write_row_separator() # If a cell contains newlines, then the row must be split up in individual rows # where each cell contains no newline. rowspanning_cells = [] - original_cells = list(cells) + original_cells = list(original_cells) while any('\n' in cell for cell in original_cells): cell_bloc = [] for i, cell in enumerate(original_cells): diff --git a/src/borg/archive.py b/src/borg/archive.py index aff947bb4..a32d10e51 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -172,11 +172,11 @@ backup_io = BackupIO() def backup_io_iter(iterator): backup_io.op = 'read' while True: - try: - with backup_io: + with backup_io: + try: item = next(iterator) - except StopIteration: - return + except StopIteration: + return yield item diff --git a/src/borg/constants.py b/src/borg/constants.py index bcdaa07da..6c13a9c98 100644 --- a/src/borg/constants.py +++ b/src/borg/constants.py @@ -34,7 +34,7 @@ MAX_DATA_SIZE = 20971479 # MAX_OBJECT_SIZE = <20 MiB (MAX_DATA_SIZE) + 41 bytes for a Repository PUT header, which consists of # a 1 byte tag ID, 4 byte CRC, 4 byte size and 32 bytes for the ID. MAX_OBJECT_SIZE = MAX_DATA_SIZE + 41 # see LoggedIO.put_header_fmt.size assertion in repository module -assert MAX_OBJECT_SIZE == 20971520 == 20 * 1024 * 1024 +assert MAX_OBJECT_SIZE == 20 * 1024 * 1024 # borg.remote read() buffer size BUFSIZE = 10 * 1024 * 1024 diff --git a/src/borg/repository.py b/src/borg/repository.py index 5a3aa735c..b443bdb4e 100644 --- a/src/borg/repository.py +++ b/src/borg/repository.py @@ -642,7 +642,8 @@ class Repository: # get rid of the old, sparse, unused segments. free space. for segment in unused: logger.debug('complete_xfer: deleting unused segment %d', segment) - assert self.segments.pop(segment) == 0, 'Corrupted segment reference count - corrupted index or hints' + count = self.segments.pop(segment) + assert count == 0, 'Corrupted segment reference count - corrupted index or hints' self.io.delete_segment(segment) del self.compact[segment] unused = []