Skip to content

Commit

Permalink
fixup! Add --encoding-aliases setting to allow alias to Python charsets
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Aug 2, 2024
1 parent bcc71e6 commit 646064f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/warc2zim/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def _create_arguments_parser() -> ArgumentParser:
encoding.split("=") for encoding in argument_value.split(",")
)
},
default={},
)

return parser
Expand Down
6 changes: 2 additions & 4 deletions src/warc2zim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@

def set_encoding_aliases(aliases: dict[str, str]):
"""Set the encoding aliases to use to decode"""
if not aliases:
return
global ENCODING_ALIASES # noqa: PLW0603
ENCODING_ALIASES = aliases
ENCODING_ALIASES.clear()
ENCODING_ALIASES.update(aliases)


def get_version():
Expand Down

0 comments on commit 646064f

Please sign in to comment.