Skip to content

Syslog support in python3 is broken #1282

@Joppie

Description

@Joppie

Problem

When running supervisord under python3 with a configuration that includes the program option stdout_syslog = true, messages do not show up in syslog.

Versions tested

  • 4.0.4
  • ff7f181 (latest master at the time)

Debugging

When running supervisord with --nodaemon, exception tracebacks reveal the problem:

Traceback (most recent call last):
  File "/home/staley/.local/lib/python3.7/site-packages/supervisor/loggers.py", line 372, in emit
    for line in message.rstrip('\n').split('\n'):
TypeError: a bytes-like object is required, not 'str'

SyslogHandler.emit is being passed a record that contains a message objects of type bytes not str. Passing str objects into the rstrip and split methods of a byte object is not allowed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions