Skip to content

Commit 5848968

Browse files
make meaningless encoding parameter from convert_file method deprecated (#340)
Signed-off-by: Christian Decker <[email protected]>
1 parent df67c94 commit 5848968

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pypandoc/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def convert_file(source_file:Union[list, str, Path, Generator], to:str, format:U
116116
:param list extra_args: extra arguments (list of strings) to be passed to pandoc
117117
(Default value = ())
118118

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

121121
:param str outputfile: output will be written to outputfile or the converted content
122122
returned if None. The output filename can be specified as a string
@@ -137,6 +137,10 @@ def convert_file(source_file:Union[list, str, Path, Generator], to:str, format:U
137137
:raises OSError: if pandoc is not found; make sure it has been installed and is available at
138138
path.
139139
"""
140+
# TODO: remove 'encoding' parameter and warning
141+
if encoding != "utf-8":
142+
logger.warning("The 'encoding' parameter will be removed in version 1.13. Just remove the parameter, because currently the method does not use it.")
143+
140144
# This if block effectively adds support for pathlib.Path objects
141145
# and generators produced by pathlib.Path().glob().
142146
if not isinstance(source_file, str):

0 commit comments

Comments
 (0)