Skip to content

Commit

Permalink
Merge pull request #6544 from ThomasWaldmann/fix-progress-archivename…
Browse files Browse the repository at this point in the history
…-master

escape % chars in archive name, fixes #6500
  • Loading branch information
ThomasWaldmann committed Apr 7, 2022
2 parents d1c018b + 911da7a commit 1e213e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/borg/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,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)
Expand Down

0 comments on commit 1e213e9

Please sign in to comment.