Summary: | [run-benchmark] Make Python 3 compatible | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jonathan Bedard <jbedard> | ||||||
Component: | Tools / Tests | Assignee: | Jonathan Bedard <jbedard> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | dewei_zhu, ews-watchlist, fpizlo, glenn, slewis, webkit-bug-importer, ysuzuki | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Jonathan Bedard
2021-10-11 07:40:14 PDT
Created attachment 440792 [details]
Patch
Comment on attachment 440792 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440792&action=review r=me > Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_browser_driver.py:107 > + ) If we decide to go with invoking decode('utf-8') on output, we may not need it here because I don't think use output from `_browser_process` anyway. > Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:73 > + **(dict(encoding='utf-8') if sys.version_info >= (3, 0) else dict()) I think encoding only available since python3.6. A most compatible way would be `process.communicate()[0].decode('utf-8')`. (In reply to dewei_zhu from comment #3) > Comment on attachment 440792 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=440792&action=review > > r=me > > > Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_browser_driver.py:107 > > + ) > > If we decide to go with invoking decode('utf-8') on output, we may not need > it here because I don't think use output from `_browser_process` anyway. > > > Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:73 > > + **(dict(encoding='utf-8') if sys.version_info >= (3, 0) else dict()) > > I think encoding only available since python3.6. > A most compatible way would be `process.communicate()[0].decode('utf-8')`. +1. We are using decode('utf-8') on pretty much all subprocess output throughout the perf. code Created attachment 440826 [details]
Patch for landing
Committed r283936 (242795@main): <https://commits.webkit.org/242795@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 440826 [details]. Committed r284004 (242847@main): <https://commits.webkit.org/242847@main> |