Skip to content

UnicodeEncodeError: 'ascii' codec can't encode character in __call_filer_cmd #18

Closed
@marxin

Description

@marxin

@brobecke, @jakubjelinek
The issue is pretty much similar to #13 and it happens here:

'ascii' codec can't encode character u'\u0161' in position 301: ordinal not in range(128)
Traceback (most recent call last):
  File "hooks/post_receive.py", line 87, in post_receive
  File "/sourceware1/projects/src-home/git-hooks/hooks/daemon.py", line 83, in run_in_daemon
    fun()
  File "/sourceware1/projects/src-home/git-hooks/hooks/updates/emails.py", line 109, in flush
    email.send()
  File "/sourceware1/projects/src-home/git-hooks/hooks/updates/emails.py", line 355, in send
    self.__call_filer_cmd()
  File "/sourceware1/projects/src-home/git-hooks/hooks/updates/emails.py", line 456, in __call_filer_cmd
    out, _ = p.communicate(to_be_filed)
  File "/usr/lib64/python2.7/subprocess.py", line 483, in communicate
    return self._communicate(input)
  File "/usr/lib64/python2.7/subprocess.py", line 1124, in _communicate
    stdout, stderr = self._communicate_with_poll(input)
  File "/usr/lib64/python2.7/subprocess.py", line 1188, in _communicate_with_poll
    input_offset += os.write(fd, chunk)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0161' in position 301: ordinal not in range(128)

we know about the input:

email_body type==<type 'unicode'>diff type==<type 'unicode'>

it happens for commits that contain e.g. š character:
https://gcc.gnu.org/pipermail/gcc-cvs/2021-January/340233.html

commit r10-5883-g6f1f3c3c5bf080a55aebdc02ed4be5ea48fbc909
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Jan 6 14:14:11 2021 +0100

    Test again.
    
    Uroš
    
            PR target/98559
            * ipa-icf.c: Modify.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions