From 70a6d75ad8fe2d6e3810e45f142d0af490938b3a Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 21 Jul 2016 17:38:51 +0200 Subject: [PATCH] improve debug output in TarFile - clarify in debug output from TarFile._dbg where it comes from via prefix - mention name of new volume in output --- deltatar/tarfile.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deltatar/tarfile.py b/deltatar/tarfile.py index 6763e7c..9be864a 100644 --- a/deltatar/tarfile.py +++ b/deltatar/tarfile.py @@ -2783,7 +2783,7 @@ class TarFile(object): self._extfileobj = False if isinstance(self.fileobj, _Stream): - self._dbg(3, 'open_volume: create a _Stream') + self._dbg(3, 'open_volume: create a _Stream for ' + name) fileobj = _Stream(name=name, mode=self.fileobj.mode, comptype=self.fileobj.comptype, @@ -2794,7 +2794,7 @@ class TarFile(object): tolerance=self.fileobj.tolerance) else: # here, we lose information about compression/encryption! - self._dbg(3, 'open_volume: builtin open') + self._dbg(3, 'open_volume: builtin open for ' + name) fileobj = bltn_open(name, self._mode) else: if name is None and hasattr(fileobj, "name"): @@ -3301,7 +3301,7 @@ class TarFile(object): """Write debugging output to sys.stderr. """ if level <= self.debug: - print(msg.format(*args), file=sys.stderr) + print('TarFile debug: ' + msg.format(*args), file=sys.stderr) def __enter__(self): self._check() -- 1.7.1