Commit d312163
committed
fix: map highlight w:val="none" to None instead of raising
`w:val="none"` is a valid `ST_HighlightColor` value that Word writes when
a highlight is explicitly cleared from a run. It has no `WD_COLOR_INDEX`
member, so reading `Font.highlight_color` on such a run raised
`ValueError: WD_COLOR_INDEX has no XML mapping for 'none'` from
`BaseXmlEnum.from_xml()`, which aborts parsing of any document containing
the value.
`none` semantically means "not highlighted", which python-docx already
represents as `None` (the value returned when no `w:highlight` element is
present), and which the `highlight_val` setter writes by removing the
element. Map the explicit `none` value to `None` in the getter to match.
`none` is the only `ST_HighlightColor` value absent from `WD_COLOR_INDEX`,
so this closes the gap completely.1 parent e454546 commit d312163
6,718 files changed
Lines changed: 843016 additions & 1 deletion
File tree
- .venv
- bin
- lib/python3.12/site-packages
- _pytest
- _code
- _io
- _py
- assertion
- config
- mark
- beautifulsoup4-4.15.0.dist-info
- licenses
- bs4
- builder
- cssselect-1.4.0.dist-info
- licenses
- cssselect
- html5lib-stubs
- _trie
- filters
- treeadapters
- treebuilders
- treewalkers
- iniconfig-2.3.0.dist-info
- licenses
- iniconfig
- lxml-6.1.1.dist-info
- licenses
- lxml-stubs
- etree
- html
- objectify
- lxml
- html
- includes
- extlibs
- libexslt
- libxml
- libxslt
- isoschematron
- resources
- rng
- xsl
- iso-schematron-xslt1
- mypy_plugin_lxml
- nodeenv-1.10.0.dist-info
- licenses
- packaging-26.2.dist-info
- licenses
- packaging
- licenses
- pip-24.0.dist-info
- pip
- _internal
- cli
- commands
- distributions
- index
- locations
- metadata
- importlib
- models
- network
- operations
- build
- install
- req
- resolution
- legacy
- resolvelib
- utils
- vcs
- _vendor
- cachecontrol
- caches
- certifi
- chardet
- cli
- metadata
- colorama
- tests
- distlib
- distro
- idna
- msgpack
- packaging
- pkg_resources
- platformdirs
- pygments
- filters
- formatters
- lexers
- styles
- pyparsing
- diagram
- pyproject_hooks
- _in_process
- requests
- resolvelib
- compat
- rich
- tenacity
- tomli
- truststore
- urllib3
- contrib
- _securetransport
- packages
- backports
- util
- webencodings
- pluggy-1.6.0.dist-info
- licenses
- pluggy
- pygments-2.20.0.dist-info
- licenses
- pygments
- filters
- formatters
- lexers
- styles
- pyparsing-3.2.3.dist-info
- pyparsing
- diagram
- tools
- pyright-1.1.410.dist-info
- licenses
- pyright
- dist
- dist
- typeshed-fallback
- stdlib
- _typeshed
- asyncio
- collections
- compression
- _common
- zstd
- concurrent
- futures
- interpreters
- ctypes
- macholib
- curses
- dbm
- distutils
- command
- email
- mime
- encodings
- ensurepip
- html
- http
- importlib
- metadata
- resources
- json
- lib2to3
- fixes
- pgen2
- logging
- math
- msilib
- multiprocessing
- dummy
- os
- pathlib
- profiling
- sampling
- pydoc_data
- pyexpat
- sqlite3
- string
- sys
- tkinter
- unittest
- urllib
- venv
- wsgiref
- xmlrpc
- xml
- dom
- etree
- parsers
- expat
- sax
- zipfile
- _path
- zoneinfo
- stubs
- Authlib
- authlib
- common
- integrations
- base_client
- django_client
- django_oauth1
- django_oauth2
- flask_client
- flask_oauth1
- flask_oauth2
- httpx_client
- requests_client
- sqla_oauth2
- starlette_client
- jose
- drafts
- rfc7515
- rfc7516
- rfc7517
- rfc7518
- rfc7519
- rfc8037
- oauth1
- rfc5849
- oauth2
- rfc6749
- grants
- rfc6750
- rfc7009
- rfc7521
- rfc7523
- rfc7591
- rfc7592
- rfc7636
- rfc7662
- rfc8414
- rfc8628
- rfc8693
- rfc9068
- rfc9101
- rfc9207
- oidc
- core
- grants
- discovery
- registration
- Deprecated
- deprecated
- Flask-Cors
- flask_cors
- Flask-Migrate
- flask_migrate
- Flask-SocketIO
- flask_socketio
- JACK-Client
- jack
- Jetson.GPIO
- Jetson
- GPIO
- Markdown
- markdown
- extensions
- PyAutoGUI
- pyautogui
- PyMeeus
- pymeeus
- PyMySQL
- pymysql
- constants
- PyScreeze
- pyscreeze
- PySocks
- PyYAML
- yaml
- Pygments
- pygments
- filters
- formatters
- lexers
- styles
- RPi.GPIO
- RPi
- GPIO
- Send2Trash
- send2trash
- TgCrypto
- tgcrypto
- WTForms
- wtforms
- csrf
- fields
- widgets
- WebOb
- webob
- aiofiles
- aiofiles
- tempfile
- threadpool
- antlr4-python3-runtime
- antlr4
- atn
- dfa
- error
- tree
- xpath
- assertpy
- assertpy
- atheris
- atheris
- auth0-python
- auth0
- authentication
- management
- aws-xray-sdk
- aws_xray_sdk
- core
- emitters
- exceptions
- models
- plugins
- sampling
- local
- streaming
- utils
- ext
- aiobotocore
- aiohttp
- botocore
- bottle
- django
- flask_sqlalchemy
- flask
- httplib
- httpx
- mysql
- pg8000
- psycopg2
- psycopg
- pymongo
- pymysql
- pynamodb
- requests
- sqlalchemy_core
- sqlalchemy
- util
- sqlite3
- behave
- behave
- binaryornot
- binaryornot
- bleach
- bleach
- boltons
- boltons
- braintree
- braintree
- dispute_details
- exceptions
- http
- graphql
- enums
- inputs
- types
- unions
- merchant_account
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments