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

make meaningless encoding parameter from convert_file method deprecated #340

Merged
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
6 changes: 5 additions & 1 deletion pypandoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def convert_file(source_file:Union[list, str, Path, Generator], to:str, format:U
:param list extra_args: extra arguments (list of strings) to be passed to pandoc
(Default value = ())

:param str encoding: the encoding of the file or the input bytes (Default value = 'utf-8')
:param str encoding (deprecated): the encoding of the input bytes (Default value = 'utf-8')

:param str outputfile: output will be written to outputfile or the converted content
returned if None. The output filename can be specified as a string
Expand All @@ -137,6 +137,10 @@ def convert_file(source_file:Union[list, str, Path, Generator], to:str, format:U
:raises OSError: if pandoc is not found; make sure it has been installed and is available at
path.
"""
# TODO: remove 'encoding' parameter and warning
if encoding != "utf-8":
logger.warning("The 'encoding' parameter will be removed in version 1.13. Just remove the parameter, because currently the method does not use it.")

# This if block effectively adds support for pathlib.Path objects
# and generators produced by pathlib.Path().glob().
if not isinstance(source_file, str):
Expand Down
Loading