-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
I saw the following error pushing a GCC commit involving diffs (to .po files) in mixed character sets.
$ git push origin master
Enumerating objects: 46, done.
Counting objects: 100% (46/46), done.
Delta compression using up to 12 threads
Compressing objects: 100% (46/46), done.
Writing objects: 100% (46/46), 5.63 MiB | 1.96 MiB/s, done.
Total 46 (delta 33), reused 0 (delta 0)
remote: Traceback (most recent call last):
remote: File "hooks/post_receive.py", line 118, in <module>
remote: post_receive(refs_data, args.submitter_email)
remote: File "hooks/post_receive.py", line 65, in post_receive
remote: submitter_email)
remote: File "hooks/post_receive.py", line 47, in post_receive_one
remote: update.send_email_notifications()
remote: File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py", line 189, in send_email_notifications
remote: self.__email_new_commits()
remote: File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py", line 1031, in __email_new_commits
remote: commit, self.get_standard_commit_email(commit))
remote: File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py", line 1011, in __send_commit_email
remote: default_diff=email.diff)
remote: File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py", line 946, in __maybe_get_email_custom_contents
remote: hook_input=json.dumps(hooks_data),
remote: File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
remote: return _default_encoder.encode(obj)
remote: File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
remote: chunks = self.iterencode(o, _one_shot=True)
remote: File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
remote: return _iterencode(o, 0)
remote: UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 47260652: invalid continuation byte
To git+ssh://gcc.gnu.org/git/gcc.git
3599ecb6a01..7d524a5de33 master -> master
If diffs are in mixed character sets (different .po file in different character sets, in this case) it might be necessary to omit some of them or inaccurately mark the character set of the email in its headers, but there should not be a UnicodeDecodeError and a commit email should always be sent.
I don't have a self-contained reproducer (so the GCC hook postprocessing the email might be involved, but since that hook is in Python 3 it's unlikely to be producing anything badly encoded itself).
Metadata
Metadata
Assignees
Labels
No labels