Skip to content

Commit

Permalink
make meaningless encoding parameter from convert_file method deprecat…
Browse files Browse the repository at this point in the history
…ed (#340)

Signed-off-by: Christian Decker <christian.decker@homag.com>
  • Loading branch information
chrisdecker1201 authored Sep 4, 2023
1 parent df67c94 commit 5848968
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 5848968

Please sign in to comment.