Skip to content
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

MAINT: Don't format logs in log call. #336

Merged
merged 1 commit into from
Jan 24, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion jupyter_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def load_config_file(self, suppress_errors=True):
# self.raise_config_file_errors
if (not suppress_errors) or self.raise_config_file_errors:
raise
self.log.warning("Error loading config file: %s" % config_file_name, exc_info=True)
self.log.warning("Error loading config file: %s", config_file_name, exc_info=True)

# subcommand-related
def _find_subcommand(self, name):
Expand Down
18 changes: 9 additions & 9 deletions jupyter_core/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ def migrate_dir(src, dst):
"""Migrate a directory from src to dst"""
log = get_logger()
if not os.listdir(src):
log.debug("No files in %s" % src)
log.debug("No files in %s", src)
return False
if os.path.exists(dst):
if os.listdir(dst):
# already exists, non-empty
log.debug("%s already exists" % dst)
log.debug("%s already exists", dst)
return False
else:
os.rmdir(dst)
log.info(f"Copying {src} -> {dst}")
log.info("Copying %s -> %s", src, dst)
ensure_dir_exists(os.path.dirname(dst))
shutil.copytree(src, dst, symlinks=True)
return True
Expand All @@ -105,9 +105,9 @@ def migrate_file(src, dst, substitutions=None):
log = get_logger()
if os.path.exists(dst):
# already exists
log.debug("%s already exists" % dst)
log.debug("%s already exists", dst)
return False
log.info(f"Copying {src} -> {dst}")
log.info("Copying %s -> %s", src, dst)
ensure_dir_exists(os.path.dirname(dst))
shutil.copy(src, dst)
if substitutions:
Expand All @@ -131,7 +131,7 @@ def migrate_one(src, dst):
elif os.path.isdir(src):
return migrate_dir(src, dst)
else:
log.debug("Nothing to migrate for %s" % src)
log.debug("Nothing to migrate for %s", src)
return False


Expand Down Expand Up @@ -163,9 +163,9 @@ def migrate_static_custom(src, dst):
custom_css_empty = css.startswith("/*") and css.endswith("*/")

if custom_js_empty:
log.debug("Ignoring empty %s" % custom_js)
log.debug("Ignoring empty %s", custom_js)
if custom_css_empty:
log.debug("Ignoring empty %s" % custom_css)
log.debug("Ignoring empty %s", custom_css)

if custom_js_empty and custom_css_empty:
# nothing to migrate
Expand Down Expand Up @@ -208,7 +208,7 @@ def migrate_config(name, env):
migrated.append(src)
else:
# don't migrate empty config files
log.debug("Not migrating empty config file: %s" % src)
log.debug("Not migrating empty config file: %s", src)
return migrated


Expand Down