Skip to content

fix: default block width when document has no sections#1569

Open
santhreal wants to merge 1 commit into
python-openxml:masterfrom
santhreal:fix/block-width-without-sections
Open

fix: default block width when document has no sections#1569
santhreal wants to merge 1 commit into
python-openxml:masterfrom
santhreal:fix/block-width-without-sections

Conversation

@santhreal

@santhreal santhreal commented Jul 18, 2026

Copy link
Copy Markdown

Document._block_width hits IndexError when add_table on document with zero sections. This PR fixes the regression with a focused test covering the case.

add_table (via _block_width) IndexError'd on sections[-1] when the body
has no sectPr. Use the same Letter page/margin defaults already applied
when those properties are None.
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.

1 participant