Skip to content

fix: accept fractional w:pgMar twips values in ST_TwipsMeasure#1552

Open
SAY-5 wants to merge 1 commit into
python-openxml:masterfrom
SAY-5:fix-1539-twips-float
Open

fix: accept fractional w:pgMar twips values in ST_TwipsMeasure#1552
SAY-5 wants to merge 1 commit into
python-openxml:masterfrom
SAY-5:fix-1539-twips-float

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Some Word documents store w:pgMar attributes like w:right="0.218505859375", which currently raises ValueError from int() when reading section.right_margin. This mirrors the rounding already done by ST_SignedTwipsMeasure so unsigned twips measures tolerate the same fractional values. Closes #1539

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.

Getting "ValueError: invalid literal for int() with base 10" error when access section's margin

1 participant