Skip to content

issue a warning when an image file does not exist [SF:patches:159] #641

@chrisjsewell

Description

@chrisjsewell

author: bariumbitmap
created: 2019-07-24 20:45:25.381000
assigned: None
SF_url: https://sourceforge.net/p/docutils/patches/159

attachments:

rst2html does not issue a warning when an image file does not exist. For example, this will not produce a warning if the file "this-does-no-exist.png" does not exist:

.. image:: this-does-not-exist.png

I have attached a patch that issues a warning when file insertion is enabled and the image URI is a file URL or a path.


commenter: milde
posted: 2019-08-19 08:50:14.201000
title: #159 issue a warning when an image file does not exist

Ticket moved from /p/docutils/bugs/368/


commenter: milde
posted: 2019-08-19 08:59:57.956000
title: #159 issue a warning when an image file does not exist

Thank you for the report and patch.
There are, however two issues:
a) The warning might interfere with the workflow for some users as the referenced file may exist in the target directory or as relative URL of the target document.
b) the "file-insertion-enabled" setting is a safety setting for cases where external files become actually part of the generated document and should not be mixed with other uses. http://docutils.sourceforge.net/docs/user/config.html#file-insertion-enabled

As the use cases differ widely, I recommend checking the links in generated documents manually or in a document generation wrapper.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions