1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-25 07:23:28 +00:00

escape % chars in archive name, fixes #6500

also: fix percentage format for float value.
This commit is contained in:
Thomas Waldmann 2022-04-07 18:03:25 +02:00
parent 269b948284
commit 911da7a1cf

View file

@ -671,8 +671,10 @@ def add(id):
archive_index = ChunkIndex()
sync = CacheSynchronizer(archive_index)
add(self.id)
# we must escape any % char in the archive name, because we use it in a format string, see #6500
arch_name_escd = self.name.replace('%', '%%')
pi = ProgressIndicatorPercent(total=len(self.metadata.items),
msg='Calculating statistics for archive %s ... %%3d%%%%' % self.name,
msg='Calculating statistics for archive %s ... %%3.0f%%%%' % arch_name_escd,
msgid='archive.calc_stats')
for id, chunk in zip(self.metadata.items, self.repository.get_many(self.metadata.items)):
pi.show(increase=1)