← 返回首页
fix: accept fractional w:pgMar twips values in ST_TwipsMeasure by SAY-5 · Pull Request #1552 · python-openxml/python-docx · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

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

Copy link
Copy Markdown

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

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.

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

1 participant

Footer

© 2026 GitHub, Inc.