post-commit hook failure

Martin Liška mliska@suse.cz
Wed Aug 25 15:45:39 GMT 2021


On 8/25/21 17:27, Lewis Hyatt via Gcc wrote:
> Hello-
> 
> I wanted to note I got some errors when pushing this commit:
> 
> commit 3ac6b5cff1eca4e1748c671960ef7b4ca5e47fd2 (HEAD -> master,
> origin/trunk, origin/master, origin/HEAD)
> Author: Lewis Hyatt <lhyatt@gmail.com>
> Date:   Tue Aug 24 19:30:44 2021 -0400
> 
>      diagnostics: Support for -finput-charset [PR93067]
> 
> The errors were:
> 
> 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 0xf5 in
> position 14638: invalid start byte

Oh yeah. Well, to be honest we somehow mix Python2 and Python3 script in the server hooks.

> 
> 
> I think the commit has pushed fine, however some expected things did
> not happen such as updating Bugzilla. The error makes some sense
> because this commit added tests with non-standard encodings, while
> python3 wants everything it reads to be utf-8 by default. I wanted to
> mention in case it breaks some other things, such as ChangeLog
> updating, that need to be addressed... Please let me know if I should
> have done something different here. Thanks!

I believe ChangeLog will be updated correctly as we don't read content of the changes:

$ ./contrib/gcc-changelog/git_check_commit.py 3ac6b5cff1eca4e1748c671960ef7b4ca5e47fd2 -p
------ gcc/c-family/ChangeLog ------

2021-08-25  Lewis Hyatt  <lhyatt@gmail.com>



	PR other/93067

	* c-opts.c (c_common_input_charset_cb): New function.

	(c_common_post_options): Call new function

	diagnostic_initialize_input_context().

------ gcc/d/ChangeLog ------

2021-08-25  Lewis Hyatt  <lhyatt@gmail.com>



	PR other/93067

...

So no action is needed for now I think.

Martin

> 
> -Lewis
> 



More information about the Gcc mailing list