Skip to content

MAINT: don't format logs in log call. #25073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/sphinxext/redirect_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def _generate_redirects(app, exception):
html = HTML_TEMPLATE.format(v=builder.get_relative_uri(k, v))
if p.is_file():
if p.read_text() != html:
logger.warning(f'A redirect-from directive is trying to '
f'create {p}, but that file already exists '
f'(perhaps you need to run "make clean")')
logger.warning('A redirect-from directive is trying to '
'create %s, but that file already exists '
'(perhaps you need to run "make clean")', p)
else:
logger.info(f'making refresh html file: {k} redirect to {v}')
logger.info('making refresh html file: %s redirect to %s', k, v)
p.parent.mkdir(parents=True, exist_ok=True)
p.write_text(html, encoding='utf-8')
2 changes: 1 addition & 1 deletion lib/matplotlib/_afm.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _parse_header(fh):
try:
converter = header_converters[key]
except KeyError:
_log.error('Found an unknown keyword in AFM header (was %r)' % key)
_log.error("Found an unknown keyword in AFM header (was %r)", key)
continue
try:
d[key] = converter(val)
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _get_glyph(self, fontname, font_class, sym):
except ValueError:
uniindex = ord('?')
found_symbol = False
_log.warning(f"No TeX to Unicode mapping for {sym!a}.")
_log.warning("No TeX to Unicode mapping for %a.", sym)

fontname, uniindex = self._map_virtual_font(
fontname, font_class, uniindex)
Expand Down Expand Up @@ -576,9 +576,9 @@ def _get_glyph(self, fontname, font_class, sym):
if (fontname in ('it', 'regular')
and isinstance(self, StixFonts)):
return self._get_glyph('rm', font_class, sym)
_log.warning(f"Font {new_fontname!r} does not have a glyph "
f"for {sym!a} [U+{uniindex:x}], substituting "
"with a dummy symbol.")
_log.warning("Font %r does not have a glyph for %a [U+%x], "
"substituting with a dummy symbol.",
new_fontname, sym, uniindex)
font = self._get_font('rm')
uniindex = 0xA4 # currency char, for lack of anything better
slanted = False
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_webagg_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def handle_event(self, event):
return handler(event)

def handle_unknown_event(self, event):
_log.warning(f'Unhandled message type {event["type"]}. {event}')
_log.warning('Unhandled message type %s. %s', event["type"], event)

def handle_ack(self, event):
# Network latency tends to decrease if traffic is flowing
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def json_dump(data, filename):
try:
json.dump(data, fh, cls=_JSONEncoder, indent=2)
except OSError as e:
_log.warning(f'Could not save font_manager cache {e}')
_log.warning('Could not save font_manager cache %s', e)


def json_load(filename):
Expand Down