JessicaTegner/pypandoc

list index out of range in `_get_pandoc_urls`

kevalmorabia97 opened this issue · 2 comments

Traceback (most recent call last):
  File "/tmp/runner/build-docs/lib/python3.8/site-packages/sphinx/config.py", line 347, in eval_config_file
    exec(code, namespace)
  File "/home/runner/work/<org>/<repo>/docs/source/conf.py", line 37, in <module>
    download_pandoc(
  File "/tmp/runner/build-docs/lib/python3.8/site-packages/pypandoc/pandoc_download.py", line 228, in download_pandoc
    pandoc_urls, _ = _get_pandoc_urls(version)
  File "/tmp/runner/build-docs/lib/python3.8/site-packages/pypandoc/pandoc_download.py", line 57, in _get_pandoc_urls
    version = pandoc_urls_list[0].split('/')[5]
IndexError: list index out of range

Seems like the logic to load the releases/ page has an empty list of URLs since it takes some time to load the URLs. This needs to be fixed ASAP as it breaks the use of pypandoc in all existing pipelines.

THanks for catching this.
It seems that GitHub has changed, how the release page are loaded.

I have a fix that I'm working on, that involves using api.github.com, that should be ready later.

The pr will be up later, for everyone to comment on before merging

Without using the API, I found that you can get direct links via that kind of URLs:

https://github.com/jgm/pandoc/releases/expanded_assets/2.19.2

Hope it helps! And I'll happily review a PR given that it breaks my current CI workflow :)