diff options
author | Jean Abou Samra <jean@abou-samra.fr> | 2023-01-30 03:11:54 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2023-01-31 16:30:11 +0100 |
commit | b69cae00b4a13cf306ec92d169b81c965a0865fc (patch) | |
tree | a6bef750d9fd875d56ddb50279d151dce58ffe3c /pygments/formatters/html.py | |
parent | 94566ea3bf85190f21cb347ef5df7e5033e43b0f (diff) | |
download | pygments-git-b69cae00b4a13cf306ec92d169b81c965a0865fc.tar.gz |
Fix lots of missing encoding="utf-8" parameters
Some of these are probably unnecessary (ASCII-only content), but it's
easier not to think about it.
Diffstat (limited to 'pygments/formatters/html.py')
-rw-r--r-- | pygments/formatters/html.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py index ee53f132..f19bef83 100644 --- a/pygments/formatters/html.py +++ b/pygments/formatters/html.py @@ -635,7 +635,7 @@ class HtmlFormatter(Formatter): # write CSS file only if noclobber_cssfile isn't given as an option. try: if not os.path.exists(cssfilename) or not self.noclobber_cssfile: - with open(cssfilename, "w") as cf: + with open(cssfilename, "w", encoding="utf-8") as cf: cf.write(CSSFILE_TEMPLATE % {'styledefs': self.get_style_defs('body')}) except OSError as err: @@ -721,7 +721,7 @@ class HtmlFormatter(Formatter): yield 0, dummyoutfile.getvalue() yield 0, '</div>' yield 0, '</td></tr></table>' - + def _wrap_inlinelinenos(self, inner): # need a list of lines since we need the width of a single number :( @@ -946,9 +946,9 @@ class HtmlFormatter(Formatter): output = source if self.wrapcode: output = self._wrap_code(output) - + output = self._wrap_pre(output) - + return output def format_unencoded(self, tokensource, outfile): |