From 67560887db764757bd2ad52ff6bde137984b4f61 Mon Sep 17 00:00:00 2001
From: lethliel <mstrigl@suse.com>
Date: Thu, 13 Dec 2018 13:33:51 +0100
Subject: [PATCH] [python3] enable full python3 support for man
---
osc/cmdln.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/osc/cmdln.py b/osc/cmdln.py
index 3d303b09..918a1da1 100644
--- a/osc/cmdln.py
+++ b/osc/cmdln.py
@@ -621,16 +621,16 @@ def do_man(self, argv):
${name} man
"""
mandate = datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
- self.stdout.write(bytes(
+ self.stdout.write(
self.man_header % {
'date': mandate.strftime('%b %Y'),
'version': self.get_version(),
'name': self.name,
'ucname': self.name.upper()
- },
- "utf-8"))
+ }
+ )
- self.stdout.write(bytes(self.man_commands_header, "utf-8"))
+ self.stdout.write(self.man_commands_header)
commands = self._help_get_command_list()
for command, doc in commands:
cmdname = command.split(' ')[0]
@@ -641,14 +641,14 @@ def do_man(self, argv):
line = line[8:]
lines.append(man_escape(line))
- self.stdout.write(bytes(
- '.TP\n\\fB%s\\fR\n%s\n' % (command, '\n'.join(lines)), "utf-8"))
+ self.stdout.write(
+ '.TP\n\\fB%s\\fR\n%s\n' % (command, '\n'.join(lines)))
- self.stdout.write(bytes(self.man_options_header, "utf-8"))
- self.stdout.write(bytes(
- man_escape(self._help_preprocess('${option_list}', None)), "utf-8"))
+ self.stdout.write(self.man_options_header)
+ self.stdout.write(
+ man_escape(self._help_preprocess('${option_list}', None)))
- self.stdout.write(bytes(self.man_footer, "utf-8"))
+ self.stdout.write(self.man_footer)
self.stdout.flush()