otaku42 / v4l2py

V4L2 python library
GNU General Public License v3.0
0 stars 0 forks source link

examples/web/ examples not backward compatible with Python < 3.10 #21

Closed otaku42 closed 1 year ago

otaku42 commented 1 year ago
└──╼ $gunicorn --bind=0.0.0.0:8000 --log-level=debug --worker-class=gevent sync:app
...
[2023-05-17 01:49:33 +0200] [26759] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/workers/ggevent.py", line 146, in init_process
    super().init_process()
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/mrenzmann/src/v4l2py-testing/.venv/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/mrenzmann/src/v4l2py-testing/examples/web/sync.py", line 24, in <module>
    from common import BOUNDARY, BaseCamera, frame_to_image
  File "/home/mrenzmann/src/v4l2py-testing/examples/web/common.py", line 38
    match frame.pixel_format:
          ^
SyntaxError: invalid syntax
...

See also https://github.com/tiagocoutinho/v4l2py/commit/e1ddab94d0042697d3b618a0d397046c45f94f8b