Skip to content
New issue

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

Error when using pypandoc.download_pandoc() on windows #189

Closed
juax335 opened this issue Apr 23, 2020 · 0 comments · Fixed by #195
Closed

Error when using pypandoc.download_pandoc() on windows #189

juax335 opened this issue Apr 23, 2020 · 0 comments · Fixed by #195
Milestone

Comments

@juax335
Copy link

juax335 commented Apr 23, 2020

Hey,

Thanks for pypandoc I have been using it for quite some while now ;). However, there is a tiny problem when using pypandoc.download_pandoc() on windows. The installer will be downloaded but cannot be executed due to a wrong path.

Steps to reproduce:

Create the following folder structure

.
├── app.py
├── download_folder
└── target_folder

Run

# using python 3.7.5
pipenv --three 

pipenv install pypandoc
pipenv run python -c "import pypandoc; print(pypandoc.__version__)"
# 1.5 

Run the following code snippet

from pathlib import Path 

import pypandoc 
print(pypandoc.__version__)

target_folder = Path('./target_folder').resolve()
download_folder = Path('./download_folder').resolve()
pypandoc.download(targetfolder=str(target_folder), download_folder=str(download_folder))

The installer will be downloaded to download_folder. However, the installer path passed to subprocess.check_call is wong. The path to the installer is generated via:

# pypandoc/download_pandoc.py line 195
filename = os.path.expanduser(download_folder) + '/' + filename

So the generated path on windows will be: C:\\Some\\Path\\to/my_installer.msi about which windows complains.

Thank you for looking into this :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants