Skip to content

hotfix: bad default_time value type introduced in #300 #302

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 1 commit into from
Jun 23, 2024
Merged
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: 7 additions & 1 deletion mkdocs_rss_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,19 @@ def on_config(self, config: MkDocsConfig) -> MkDocsConfig:
self.config.date_from_meta.default_time = datetime.strptime(
self.config.date_from_meta.default_time, "%H:%M"
)
print(
self.config.date_from_meta.default_time,
type(self.config.date_from_meta.default_time),
)
except (TypeError, ValueError) as err:
logger.warning(
"Config error: `date_from_meta.default_time` value "
f"'{self.config.date_from_meta.default_time}' format doesn't match the "
f"expected format %H:%M. Fallback to the default value. Trace: {err}"
)
self.config.date_from_meta.default_time = "00:00"
self.config.date_from_meta.default_time = datetime.strptime(
"00:00", "%H:%M"
)

if self.config.use_git:
logger.debug(
Expand Down