Bug 256036
Summary: | process-css-properties.py fails for some host locales when trying to decode JSON as GBK | ||
---|---|---|---|
Product: | WebKit | Reporter: | javalitterboy |
Component: | WebCore Misc. | Assignee: | Fujii Hironori <fujii.hironori> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ap, darin, fujii.hironori, sam, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Local Build | ||
Hardware: | PC | ||
OS: | Windows 10 |
javalitterboy
Fix JSON parsing failure during Windows platform compilation.
Windows 10 x64 VS2022
perl Tools/Scripts/build-webkit --wincairo --release --no-ninja --generate-project-only
Generate WebCore.
10>Traceback (most recent call last):
10> File "E:/GitHub/WebKit/Source/WebCore/css/process-css-properties.py", line 6142, in <module>
10> main()
10> File "E:/GitHub/WebKit/Source/WebCore/css/process-css-properties.py", line 6109, in main
10> properties_json = json.load(properties_file)
10> File "C:\Users\14183\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 293, in load
10> return loads(fp.read(),
10>UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 400278: illegal multibyte sequence
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
We should specify an encoding (probably UTF-8 or ASCII) when opening the file, so that nothing locale specific happens during the build.
Regressed with Python rewrite in https://commits.webkit.org/256414@main.
Fujii Hironori
Could you try removing "ยง" in CSSProperties.json? I think this is the simplest solution if it fixes.
https://github.com/WebKit/WebKit/blob/b1cc64631025e09fd181bffbb11e292604ab5ad1/Source/WebCore/css/CSSProperties.json#L10467
Other solutions are set env var PYTHONUTF8=1 or "-X utf8" command switch.
Fujii Hironori
I didn't read comment#1. It's better idea. I'm going to create a PR.
Fujii Hironori
Pull request: https://github.com/WebKit/WebKit/pull/13256
Fujii Hironori
Could you test the patch? Do we need more changes?
EWS
Committed 263543@main (aad6f77b647e): <https://commits.webkit.org/263543@main>
Reviewed commits have been landed. Closing PR #13256 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/108717925>