We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When trying to convert a file to PDF, passing a pathlib.Path object in the outputfile argument causes a TypeError:
pathlib.Path
outputfile
>>> pypandoc.convert_file("README.md", to="pdf", outputfile=Path("test.pdf")) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.10/site-packages/pypandoc/__init__.py", line 168, in convert_file return _convert_input(discovered_source_files, format, 'path', to, extra_args=extra_args, File "/usr/lib/python3.10/site-packages/pypandoc/__init__.py", line 328, in _convert_input format, to = _validate_formats(format, to, outputfile) File "/usr/lib/python3.10/site-packages/pypandoc/__init__.py", line 306, in _validate_formats if outputfile[-4:] != ".pdf": TypeError: 'PosixPath' object is not subscriptable
because the _validate_formats function assumes outputfile is always a string.
_validate_formats
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When trying to convert a file to PDF, passing a
pathlib.Path
object in theoutputfile
argument causes a TypeError:because the
_validate_formats
function assumesoutputfile
is always a string.The text was updated successfully, but these errors were encountered: