Title: Feature: Add support for .dotx Word templates (#1532) by coderamaster · Pull Request #1537 · python-openxml/python-docx · GitHub
Open Graph Title: Feature: Add support for .dotx Word templates (#1532) by coderamaster · Pull Request #1537 · python-openxml/python-docx
X Title: Feature: Add support for .dotx Word templates (#1532) by coderamaster · Pull Request #1537 · python-openxml/python-docx
Description: Description Fixes #1532. Adds support for loading Word template files (.dotx) with python-docx.Document(). Problem Loading a .dotx file currently raises a ValueError due to an unsupported content type. Even if bypassed, the part factory creates a generic Part instead of DocumentPart, causing an AttributeError. Solution Treat .dotx templates the same as .docx documents, which matches the OOXML spec. Changes: Accept Word template main content type Map template content type to DocumentPart Add tests for .dotx loading Testing Added tests for .dotx files Verified with a real template created in Microsoft Word Confirmed .docx behavior remains unchanged
Open Graph Description: Description Fixes #1532. Adds support for loading Word template files (.dotx) with python-docx.Document(). Problem Loading a .dotx file currently raises a ValueError due to an unsupported content ...
X Description: Description Fixes #1532. Adds support for loading Word template files (.dotx) with python-docx.Document(). Problem Loading a .dotx file currently raises a ValueError due to an unsupported content ...
Opengraph URL: https://github.com/python-openxml/python-docx/pull/1537
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:a7a5ea86-d305-dbfd-f820-2a4fb53ed28f |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 84DA:2558A5:18FF472:220FEF4:69729C81 |
| html-safe-nonce | a6ad56d328c6efbb062660b0af9066701da067f6d07cce1a051d8456354526e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NERBOjI1NThBNToxOEZGNDcyOjIyMEZFRjQ6Njk3MjlDODEiLCJ2aXNpdG9yX2lkIjoiMzA3NTc4MTI2Mzg5ODA5MDYyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 81cd28551ded86c55481f54866f45c323e695c629337b48c6051aa2b795e2b02 |
| hovercard-subject-tag | pull_request:3195654622 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-openxml/python-docx/pull/1537/checks |
| twitter:image | https://avatars.githubusercontent.com/u/244767141?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/244767141?s=400&v=4 |
| og:image:alt | Description Fixes #1532. Adds support for loading Word template files (.dotx) with python-docx.Document(). Problem Loading a .dotx file currently raises a ValueError due to an unsupported content ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openxml/python-docx git https://github.com/python-openxml/python-docx.git |
| octolytics-dimension-user_id | 3403760 |
| octolytics-dimension-user_login | python-openxml |
| octolytics-dimension-repository_id | 13592924 |
| octolytics-dimension-repository_nwo | python-openxml/python-docx |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 13592924 |
| octolytics-dimension-repository_network_root_nwo | python-openxml/python-docx |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e746f1a3ddb5c0a91290ff3d5889b5247e0e519e |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width