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/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8669e451-21b3-695c-24d7-8bfcade3f20f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CB8E:113351:26144C7:33CD455:697362D7 |
| html-safe-nonce | bb3939e064e04ec85a156513cbc8f23eb2627d01bd93d63fab64d5c1b42f49ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjhFOjExMzM1MToyNjE0NEM3OjMzQ0Q0NTU6Njk3MzYyRDciLCJ2aXNpdG9yX2lkIjoiNjYyODI4MzIwMjczMDY4MTA0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3cb50ab9546686f8d94e6ec7eeb946d225c253f315b3ba13af58a18d9ece75a2 |
| hovercard-subject-tag | pull_request:3195654622 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/files |
| 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 | 4cf879a11b0a28a85543899a36aaee9ec9ca2fb7bedad86c0da5731193c95f01 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fe8be790582ef7a55477ce1918ac0ed16b106d31 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width