From e7c0883fcf4afb987947516640e0505a1d4bed1e Mon Sep 17 00:00:00 2001 From: Frank Schreiner Date: Thu, 20 Jul 2023 15:55:47 +0200 Subject: [PATCH] fix for python2 --- TarSCM/config.py | 14 +++++++++++--- debian/changelog | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/TarSCM/config.py b/TarSCM/config.py index 704cc605..92891d82 100644 --- a/TarSCM/config.py +++ b/TarSCM/config.py @@ -66,9 +66,17 @@ def _init_config(self, fname): if self.fakeheader: logging.debug("Using fakeheader for file '%s'", fname) - fake_header = '[' + self.default_section + ']\n' - config.read_string(fake_header + open(fname, 'r').read(), - source=fname) + try: + fake_header = '[' + self.default_section + ']\n' + config.read_string(fake_header + open(fname, 'r').read(), + source=fname) + except AttributeError: + tmp_fp = StringIO() + tmp_fp.write('[' + self.default_section + ']\n') + tmp_fp.write(open(fname, 'r').read()) + tmp_fp.seek(0, os.SEEK_SET) + config.readfp(tmp_fp) + else: config.read(fname) diff --git a/debian/changelog b/debian/changelog index 98778b78..73ff774b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +obs-service-tar-scm (0.10.41) unstable; urgency=medium + + * update to upstream version 0.10.41 + + -- Frank Schreiner Thu, 20 Jul 2023 15:55:12 +0200 + obs-service-tar-scm (0.10.40) unstable; urgency=medium * update to upstream version 0.10.40