René's URL Explorer Experiment


Title: Non-integer font sizes · Issue #1475 · python-openxml/python-docx · GitHub

Open Graph Title: Non-integer font sizes · Issue #1475 · python-openxml/python-docx

X Title: Non-integer font sizes · Issue #1475 · python-openxml/python-docx

Description: version: 1.1.2 I have multiple documents (which, unfortunately, I'm not able to share directly) that I can open just fine in word, but when I try to access a run.font.size on a certain cursed run, I get an error like this: ValueError: in...

Open Graph Description: version: 1.1.2 I have multiple documents (which, unfortunately, I'm not able to share directly) that I can open just fine in word, but when I try to access a run.font.size on a certain cursed run, ...

X Description: version: 1.1.2 I have multiple documents (which, unfortunately, I'm not able to share directly) that I can open just fine in word, but when I try to access a run.font.size on a certain cursed r...

Opengraph URL: https://github.com/python-openxml/python-docx/issues/1475

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Non-integer font sizes","articleBody":"version: 1.1.2\n\nI have multiple documents (which, unfortunately, I'm not able to share directly) that I can open just fine in word, but when I try to access a `run.font.size` on a certain cursed run, I get an error like this: `ValueError: invalid literal for int() with base 10: '36.56250317891439'`\n\nHere's a full traceback:\n```python\n---\u003e 40     return run.font.size\nFile /local_disk0/.ephemeral_nfs/envs/pythonEnv-46f9411e-ed8b-4f5f-ac48-4707bd9781bd/lib/python3.10/site-packages/docx/text/font.py:273, in Font.size(self)\n    272     return None\n--\u003e 273 return rPr.sz_val\nFile /local_disk0/.ephemeral_nfs/envs/pythonEnv-46f9411e-ed8b-4f5f-ac48-4707bd9781bd/lib/python3.10/site-packages/docx/oxml/text/font.py:300, in CT_RPr.sz_val(self)\n    299     return None\n--\u003e 300 return sz.val\nFile /local_disk0/.ephemeral_nfs/envs/pythonEnv-46f9411e-ed8b-4f5f-ac48-4707bd9781bd/lib/python3.10/site-packages/docx/oxml/xmlchemy.py:258, in RequiredAttribute._getter.\u003clocals\u003e.get_attr_value(obj)\n    255     raise InvalidXmlError(\n    256         \"required '%s' attribute not present on element %s\" % (self._attr_name, obj.tag)\n    257     )\n--\u003e 258 return self._simple_type.from_xml(attr_str_value)\nFile /local_disk0/.ephemeral_nfs/envs/pythonEnv-46f9411e-ed8b-4f5f-ac48-4707bd9781bd/lib/python3.10/site-packages/docx/oxml/simpletypes.py:26, in BaseSimpleType.from_xml(cls, xml_value)\n     24 @classmethod\n     25 def from_xml(cls, xml_value: str) -\u003e Any:\n---\u003e 26     return cls.convert_from_xml(xml_value)\nFile /local_disk0/.ephemeral_nfs/envs/pythonEnv-46f9411e-ed8b-4f5f-ac48-4707bd9781bd/lib/python3.10/site-packages/docx/oxml/simpletypes.py:265, in ST_HpsMeasure.convert_from_xml(cls, str_value)\n    264     return ST_UniversalMeasure.convert_from_xml(str_value)\n--\u003e 265 return Pt(int(str_value) / 2.0)\nValueError: invalid literal for int() with base 10: '36.56250317891439'\n```\n\nI'm guessing this is something similar to an earlier issue, #1335, where the XML schema says this is invalid but there must be some way it ends up happening, but it doesn't break Microsoft Word. Given that this int is being instantly converted to a float, it seems likely that it will be completely harmless to just change `int` to `float` on `docx/oxml/simpletypes.py:265`","author":{"url":"https://github.com/ThomasProctor","@type":"Person","name":"ThomasProctor"},"datePublished":"2025-03-12T20:47:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1475/python-docx/issues/1475"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:018ce94b-a648-5767-7139-1aee22112790
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD1CE:2C86E:4B1178:6605BF:696E75CD
html-safe-nonce2a4a968a4f4f89866849082177f30b661eb9d29aa11d68c8c8676052f058a281
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUNFOjJDODZFOjRCMTE3ODo2NjA1QkY6Njk2RTc1Q0QiLCJ2aXNpdG9yX2lkIjoiODI5Nzk4NzUwNzUzNzk5OTMwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac73ad1303e59ad7e3cded1d3b7d55e892edba2f866abe7ca0e70abfffa6c6c718
hovercard-subject-tagissue:2915128146
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openxml/python-docx/1475/issue_layout
twitter:imagehttps://opengraph.githubassets.com/393b37721b2cb7052c08299016fe365fb7aab87ec6b3e2cfe26bfa640dd09ca4/python-openxml/python-docx/issues/1475
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/393b37721b2cb7052c08299016fe365fb7aab87ec6b3e2cfe26bfa640dd09ca4/python-openxml/python-docx/issues/1475
og:image:altversion: 1.1.2 I have multiple documents (which, unfortunately, I'm not able to share directly) that I can open just fine in word, but when I try to access a run.font.size on a certain cursed run, ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameThomasProctor
hostnamegithub.com
expected-hostnamegithub.com
None01185010a96388a2a8cd8bd7f5824fdf090522b219f9aecf8c7ff1857aeb489b
turbo-cache-controlno-preview
go-importgithub.com/python-openxml/python-docx git https://github.com/python-openxml/python-docx.git
octolytics-dimension-user_id3403760
octolytics-dimension-user_loginpython-openxml
octolytics-dimension-repository_id13592924
octolytics-dimension-repository_nwopython-openxml/python-docx
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id13592924
octolytics-dimension-repository_network_root_nwopython-openxml/python-docx
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release673a80c1bce2a1e6a48b530ce2b72bf8fd253386
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-openxml/python-docx/issues/1475#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-openxml%2Fpython-docx%2Fissues%2F1475
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-openxml%2Fpython-docx%2Fissues%2F1475
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python-openxml%2Fpython-docx
Reloadhttps://github.com/python-openxml/python-docx/issues/1475
Reloadhttps://github.com/python-openxml/python-docx/issues/1475
Reloadhttps://github.com/python-openxml/python-docx/issues/1475
python-openxml https://github.com/python-openxml
python-docxhttps://github.com/python-openxml/python-docx
Notifications https://github.com/login?return_to=%2Fpython-openxml%2Fpython-docx
Fork 1.3k https://github.com/login?return_to=%2Fpython-openxml%2Fpython-docx
Star 5.4k https://github.com/login?return_to=%2Fpython-openxml%2Fpython-docx
Code https://github.com/python-openxml/python-docx
Issues 577 https://github.com/python-openxml/python-docx/issues
Pull requests 121 https://github.com/python-openxml/python-docx/pulls
Actions https://github.com/python-openxml/python-docx/actions
Projects 0 https://github.com/python-openxml/python-docx/projects
Wiki https://github.com/python-openxml/python-docx/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python-openxml/python-docx/security
Please reload this pagehttps://github.com/python-openxml/python-docx/issues/1475
Insights https://github.com/python-openxml/python-docx/pulse
Code https://github.com/python-openxml/python-docx
Issues https://github.com/python-openxml/python-docx/issues
Pull requests https://github.com/python-openxml/python-docx/pulls
Actions https://github.com/python-openxml/python-docx/actions
Projects https://github.com/python-openxml/python-docx/projects
Wiki https://github.com/python-openxml/python-docx/wiki
Security https://github.com/python-openxml/python-docx/security
Insights https://github.com/python-openxml/python-docx/pulse
New issuehttps://github.com/login?return_to=https://github.com/python-openxml/python-docx/issues/1475
New issuehttps://github.com/login?return_to=https://github.com/python-openxml/python-docx/issues/1475
Non-integer font sizeshttps://github.com/python-openxml/python-docx/issues/1475#top
https://github.com/ThomasProctor
https://github.com/ThomasProctor
ThomasProctorhttps://github.com/ThomasProctor
on Mar 12, 2025https://github.com/python-openxml/python-docx/issues/1475#issue-2915128146
#1335https://github.com/python-openxml/python-docx/issues/1335
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.