Skip to content

docs: make front-page example not fail when image is missing - #1578

Open
ChenfromChina123 wants to merge 1 commit into
python-openxml:masterfrom
ChenfromChina123:docs/frontpage-example-fix
Open

docs: make front-page example not fail when image is missing#1578
ChenfromChina123 wants to merge 1 commit into
python-openxml:masterfrom
ChenfromChina123:docs/frontpage-example-fix

Conversation

@ChenfromChina123

Copy link
Copy Markdown

What does this PR do?

Fixes the front-page example so it runs out of the box. The example previously called document.add_picture('monty-truth.png', ...) unconditionally, which raises FileNotFoundError when the image is not present in the working directory (the file only exists under tests/test_files/).

Closes #128

Changes

  • docs/index.rst: wrap the add_picture call in a try/except FileNotFoundError so the example works without the image.

Verification

  • docutils.core.publish_doctree parses the updated index.rst without errors.

The example calls add_picture('monty-truth.png') which raises
FileNotFoundError when the file is not present in the working
directory. Wrap it in a try/except so the example runs out of
the box.

Closes python-openxml#128

Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
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 this pull request may close these issues.

example does not work : ' recordset' undefined, image not available

1 participant