Bug 244682 - [GLib][webkitpy] Script apply-build-revision-to-files.py does not work with Python 3.10
Summary: [GLib][webkitpy] Script apply-build-revision-to-files.py does not work with P...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-01 11:36 PDT by Adrian Perez
Modified: 2022-09-26 13:08 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2022-09-01 11:36:24 PDT
Traceback (most recent call last):
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/glib/apply-build-revision-to-files.py", line 68, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/glib/apply-build-revision-to-files.py", line 41, in main
    build_revision = get_build_revision()
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/glib/apply-build-revision-to-files.py", line 32, in get_build_revision
    return str(repository.find("HEAD", include_log=False))
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 871, in find
    return self.commit(hash=output.stdout.rstrip(), include_log=include_log, include_identifier=include_identifier)
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 685, in commit
    cached_identifier = self.cache.to_identifier(hash=hash, branch=branch) if self.cache else None
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 295, in to_identifier
    self.populate(branch=branch)
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 114, in populate
    self.populate(branch=self.repo.default_branch, remote=self.repo.default_remote)
  File "/home/aperez/buildroot/output-rpi4test/build/wpewebkit-custom/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 162, in populate
    line = log.stdout.readline()
  File "/home/aperez/buildroot/output-rpi4test/per-package/wpewebkit/host/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xea in position 4655: invalid continuation byte
Comment 1 Adrian Perez 2022-09-01 11:40:34 PDT
Populating the cache only needs to parse identifiers which should be
exclusively ASCII, so as long as we get to read those, it does not
matter what's the encoding of Git commit logs. I think it would be
good to use an ASCII stream reader that ignores decoding errors to
make the code more robust to whatever oddball content may be present
in commit logs.
Comment 2 Adrian Perez 2022-09-01 14:12:23 PDT
Pull request: https://github.com/WebKit/WebKit/pull/3931
Comment 3 Adrian Perez 2022-09-26 13:08:42 PDT
This should not be an issue after 254851@main