Skip to content

SyntaxError: invalid syntax when running supervisor-stdout plugin on Python 3.8 #1434 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kristijorgji opened this issue May 18, 2021 · 3 comments

Comments

@kristijorgji
Copy link

Supervisor/supervisor#1434

@mnaberez
Copy link

Supervisor/supervisor#1434:

The problem

I installed supervisor using pip like:

pip install supervisor supervisor-stdout

Installation was succesful. Then trying to open supervisord crashes:

ubuntu:~$ supervisord
Traceback (most recent call last):
  File "/usr/local/bin/supervisord", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/supervisor/supervisord.py", line 352, in main
    options.realize(args, doc=__doc__)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 485, in realize
    Options.realize(self, *arg, **kw)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 310, in realize
    self.process_config()
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 549, in process_config
    Options.process_config(self, do_usage=do_usage)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 318, in process_config
    self.process_config_file(do_usage)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 348, in process_config_file
    self.read_config(self.configfile)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 671, in read_config
    section.process_group_configs = self.process_groups_from_parser(parser)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 752, in process_groups_from_parser
    result_handler = self.import_spec(result_handler)
  File "/usr/local/lib/python3.8/dist-packages/supervisor/options.py", line 393, in import_spec
    return ep.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.8/dist-packages/supervisor_stdout.py", line 22
    print '%s %s | %s'%(headers['processname'], headers['channel'], data),
          ^
SyntaxError: invalid syntax

My setup and versions

Ubuntu 20.04

pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
ubuntu:~$ python3 --version
Python 3.8.5

Please note the last lines of the traceback above:

  File "/usr/local/lib/python3.8/dist-packages/supervisor_stdout.py", line 22
    print '%s %s | %s'%(headers['processname'], headers['channel'], data),
          ^
SyntaxError: invalid syntax

@cweiske
Copy link

cweiske commented Aug 24, 2021

This has been fixed in this git repository already - but the last released version on pypi is 0.1.1, which is from 2012.

The solution to this problem would be to release a new version on pypi.


You can also install from the repository directly, see #19 (comment):

pip install git+https://github.com/coderanger/supervisor-stdout

@olivebay
Copy link

@cweiske is there a plan to update pypi?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants