Skip to content

Commit 7756ace

Browse files
Remove the encoding parameter (#391)
The parameter is not used in-code and was scheduled for removal in v1.13. Co-authored-by: Jessica Tegner <jessica@jessicategner.com>
1 parent e1e5bf3 commit 7756ace

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pypandoc/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def convert_text(source:str, to:str, format:str, extra_args:Iterable=(), encodin
9797

9898

9999
def convert_file(source_file:Union[list, str, Path, Iterator], to:str, format:Union[str, None]=None,
100-
extra_args:Iterable=(), encoding:str='utf-8', outputfile:Union[None, str, Path]=None,
100+
extra_args:Iterable=(), outputfile:Union[None, str, Path]=None,
101101
filters:Union[Iterable, None]=None, verify_format:bool=True, sandbox:bool=False,
102102
cworkdir:Union[str, None]=None, sort_files=True) -> str:
103103
"""Converts given `source` from `format` to `to`.
@@ -118,8 +118,6 @@ def convert_file(source_file:Union[list, str, Path, Iterator], to:str, format:Un
118118
:param list extra_args: extra arguments (list of strings) to be passed to pandoc
119119
(Default value = ())
120120
121-
:param str encoding (deprecated): the encoding of the input bytes (Default value = 'utf-8')
122-
123121
:param str outputfile: output will be written to outputfile or the converted content
124122
returned if None. The output filename can be specified as a string
125123
or pathlib.Path object. (Default value = None)
@@ -148,10 +146,6 @@ def convert_file(source_file:Union[list, str, Path, Iterator], to:str, format:Un
148146
if cworkdir is None:
149147
cworkdir = os.getcwd()
150148

151-
# TODO: remove 'encoding' parameter and warning
152-
if encoding != "utf-8":
153-
logger.warning("The 'encoding' parameter will be removed in version 1.13. Just remove the parameter, because currently the method does not use it.")
154-
155149
if _is_network_path(source_file): # if the source_file is an url
156150
format = _identify_format_from_path(source_file, format)
157151
return _convert_input(source_file, format, 'path', to, extra_args=extra_args,

0 commit comments

Comments
 (0)