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
Hello. Sorry my bad english.
I install pypandoc by pip, i used the command:
pip install pypandoc_binary
But when i run simple script to convert file, this throws an exception. Script example:
import pypandoc pypandoc.convert_file(os.path.abspath('00_01_start.txt'), to='markdown', format='dokuwiki', outputfile='00_01_start.md')
Exception in REPL:
Traceback (most recent call last): File "D:\my\projects\howdo_faq\[source]\wiki.qsp.org.mw\convert.py", line 18, in <module> main() File "D:\my\projects\howdo_faq\[source]\wiki.qsp.org.mw\convert.py", line 10, in main output = pypandoc.convert_file(os.path.abspath('00_01_start.txt'), to='markdown', format='dokuwiki', outputfile='00_01_start.md') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\aleks\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypandoc\__init__.py", line 200, in convert_file return _convert_input(discovered_source_files, format, 'path', to, extra_args=extra_args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\aleks\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypandoc\__init__.py", line 383, in _convert_input input_file = sorted(input_file) ^^^^^^^^^^^^^^^^^^ TypeError: 'WindowsPath' object is not iterable
Exception in VS Code terminal:
Traceback (most recent call last): File "d:\my\projects\howdo_faq\[source]\wiki.qsp.org.mw\convert.py", line 18, in <module> main() File "d:\my\projects\howdo_faq\[source]\wiki.qsp.org.mw\convert.py", line 10, in main output = pypandoc.convert_file(os.path.abspath('00_01_start.txt'), to='markdown', format='dokuwiki', outputfile='00_01_start.md') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\aleks\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypandoc\__init__.py", line 195, in convert_file raise RuntimeError("source_file is not a valid path") RuntimeError: source_file is not a valid path
Input File is exist. Path to input file is string.
I use:
Windows 10 Pro x64 22H2 Python: 3.12.5 Pypandoc: 2.19.2
If i use ".convert_text()" method, the exceptions do not appear.
What do I wrong?
The text was updated successfully, but these errors were encountered:
I look at the pypandoc's __init__.py. Method '_convert_input()'. Change line 383 by this line:
__init__.py
input_file = [str(source)]
and script is work. But I don't know, where source parameter transform in WindowsPath, and and how will this affect the rest of the code.
source
Sorry, something went wrong.
No branches or pull requests
Hello. Sorry my bad english.
I install pypandoc by pip, i used the command:
But when i run simple script to convert file, this throws an exception. Script example:
Exception in REPL:
Exception in VS Code terminal:
Input File is exist. Path to input file is string.
I use:
Windows 10 Pro x64 22H2
Python: 3.12.5
Pypandoc: 2.19.2
If i use ".convert_text()" method, the exceptions do not appear.
What do I wrong?
The text was updated successfully, but these errors were encountered: