Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error when downloading paper with '/' in short id #117

@larstz

Description

@larstz

Description

If the short id of a paper contains a '/' downloading the source or pdf without providing a filename results in FileNotFoundError: [Errno 2] No such file or directory: './hep-ex/0406020v1.Sparticle_Reconstruction_at_LHC.pdf'

I guess the reason for this is the behaviour of the _get_default_filename() method, as it uses as filename the entire get_short_id including the '/'.

Similar for papers with '/' in the title see for example search = arxiv.Search(id_list=['1211.0496v1'])

Steps to reproduce

search = arxiv.Search(id_list=['hep-ex/0406020v1'])
paper = next(search.results())
paper.download_pdf()

Expected behavior

Downloading the source or pdf of a paper without providing the filename should work the same way for every paper. Maybe one could replace all '/' contained with character that can not be confused with a directory (e.g. '.' like in most paper ids).

Versions

  • python version: 3.11.4

  • arxiv.py version: 1.4.7

Metadata

Metadata

Assignees

Labels

bugDeviations from documented behavior.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions