WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
256036
process-css-properties.py fails for some host locales when trying to decode JSON as GBK
https://bugs.webkit.org/show_bug.cgi?id=256036
Summary
process-css-properties.py fails for some host locales when trying to decode J...
javalitterboy
Reported
2023-04-27 03:05:19 PDT
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
Comment 1
2023-04-27 17:38:23 PDT
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
Comment 2
2023-04-27 17:54:43 PDT
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
Comment 3
2023-04-27 18:19:24 PDT
I didn't read
comment#1
. It's better idea. I'm going to create a PR.
Fujii Hironori
Comment 4
2023-04-27 18:22:05 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/13256
Fujii Hironori
Comment 5
2023-04-27 18:23:09 PDT
Could you test the patch? Do we need more changes?
EWS
Comment 6
2023-04-30 13:22:16 PDT
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
Comment 7
2023-04-30 13:23:18 PDT
<
rdar://problem/108717925
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug