Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2373 closed defect (fixed)

Exception caught notifying <buildbot.status.mail.MailNotifier

Reported by: materialdreams Owned by:
Priority: major Milestone: 0.8.+
Version: 0.8.6p1 Keywords: mail, encoding
Cc:

Description

After updating to 0.8.6p1 buildbot is no longer able to send Email notifications. I have attached a file with the error stack.

Attachments (1)

buildbot.txt (2.0 KB) - added by materialdreams 7 years ago.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by materialdreams

comment:1 follow-up: Changed 7 years ago by dustin

  • Keywords mail encoding added; exception buildbot.status.mail.MailNotifier removed
  • Milestone changed from undecided to 0.8.+

The problem here is that log output doesn't have an encoding. The MailNotifier assumes utf-8, but that guess seems wrong in this case.

If you know what the encoding is, you can set it where LOG_ENCODING is set near the top of mail.py. Otherwise, you can change line 584 to read

            text = text.decode(LOG_ENCODING, errors='replace')

Maybe we should do the latter by default? Ideally the logs would get an encoding when they come *in* to buildbot, rather than being stored as bytestrings :(

comment:2 in reply to: ↑ 1 Changed 7 years ago by materialdreams

Replying to dustin:

The problem here is that log output doesn't have an encoding. The MailNotifier assumes utf-8, but that guess seems wrong in this case.

If you know what the encoding is, you can set it where LOG_ENCODING is set near the top of mail.py. Otherwise, you can change line 584 to read

            text = text.decode(LOG_ENCODING, errors='replace')

Maybe we should do the latter by default? Ideally the logs would get an encoding when they come *in* to buildbot, rather than being stored as bytestrings :(

The suggested change solves the problem but (at least in my environment) the named parameter (errors) raises an exception.

This

text = text.decode(LOG_ENCODING, 'replace')

works!

comment:3 Changed 7 years ago by Dustin J. Mitchell

Use 'replace' when decoding logfiles as UTF-8

Since logfiles may not be in UTF-8, and may in fact not be in any particular encoding, this is reasonable. Refs #2373.

Changeset: 0ce60c971639c8790a4fd95513f4f3c872c86140

comment:4 Changed 7 years ago by Dustin J. Mitchell

Use 'replace' when decoding logfiles as UTF-8

Since logfiles may not be in UTF-8, and may in fact not be in any particular encoding, this is reasonable. Refs #2373.

Changeset: 0ce60c971639c8790a4fd95513f4f3c872c86140

comment:5 Changed 7 years ago by dustin

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 7 years ago by Dustin J. Mitchell

Use 'replace' when decoding logfiles as UTF-8

Since logfiles may not be in UTF-8, and may in fact not be in any particular encoding, this is reasonable. Refs #2373.

Changeset: b7c9a0f0ed0ed0e9a76ea0cbe5ce1500c6d2752a

comment:7 Changed 7 years ago by Dustin J. Mitchell

Use 'replace' when decoding logfiles as UTF-8

Since logfiles may not be in UTF-8, and may in fact not be in any particular encoding, this is reasonable. Refs #2373.

Changeset: b7c9a0f0ed0ed0e9a76ea0cbe5ce1500c6d2752a

comment:8 Changed 7 years ago by Dustin J. Mitchell

Use 'replace' when decoding logfiles as UTF-8

Since logfiles may not be in UTF-8, and may in fact not be in any particular encoding, this is reasonable. Refs #2373.

Changeset: b7c9a0f0ed0ed0e9a76ea0cbe5ce1500c6d2752a

Note: See TracTickets for help on using tickets.