FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: make front-page example not fail when image is missing by ChenfromChina123 · Pull Request #1578 · python-openxml/python-docx · GitHub

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

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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL