diff --git a/qutebrowser/misc/editor.py b/qutebrowser/misc/editor.py index 4211fe184..9cedf6250 100644 --- a/qutebrowser/misc/editor.py +++ b/qutebrowser/misc/editor.py @@ -82,7 +82,7 @@ class ExternalEditor(QObject): encoding = config.get('general', 'editor-encoding') try: with open(self._filename, 'r', encoding=encoding) as f: - text = ''.join(f.readlines()) # pragma: no branch + text = f.read() # pragma: no branch except OSError as e: # NOTE: Do not replace this with "raise CommandError" as it's # executed async. diff --git a/qutebrowser/misc/lineparser.py b/qutebrowser/misc/lineparser.py index 4a5e1f3ff..8e6cb4aba 100644 --- a/qutebrowser/misc/lineparser.py +++ b/qutebrowser/misc/lineparser.py @@ -213,9 +213,9 @@ class LineParser(BaseLineParser): """Read the data from self._configfile.""" with self._open('r') as f: if self._binary: - self.data = [line.rstrip(b'\n') for line in f.readlines()] + self.data = [line.rstrip(b'\n') for line in f] else: - self.data = [line.rstrip('\n') for line in f.readlines()] + self.data = [line.rstrip('\n') for line in f] def save(self): """Save the config file.""" diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 6975ba5fa..cf1112689 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -112,7 +112,7 @@ def _release_info(): for fn in glob.glob("/etc/*-release"): try: with open(fn, 'r', encoding='utf-8') as f: - data.append((fn, ''.join(f.readlines()))) # pragma: no branch + data.append((fn, f.read())) # pragma: no branch except OSError: log.misc.exception("Error while reading {}.".format(fn)) return data