PyVirtualDisplay
PyVirtualDisplay copied to clipboard
XIO: fatal IO error 22 (Invalid argument) on X server ":0" after 143 requests (136 known processed) with 12 events remaining.
I use in a docker container with
from pyvirtualdisplay import Display
disp = Display().start()
# my code
disp.stop()
after runing,I got the output as follow:
XIO: fatal IO error 22 (Invalid argument) on X server ":0"
after 143 requests (136 known processed) with 12 events remaining.
but when i use xvfb-run python code.py
, the fatal IO error would not appear.
How can I fix it?
I can't reproduce your use case. I did this based on the report:
$ cat Dockerfile
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y xvfb
RUN apt-get install -y python3 python3-pip
RUN pip3 install pyvirtualdisplay
$ docker build . -t xvfb-test
$ docker run --rm -it xvfb-test bash
# python3 -c "from pyvirtualdisplay import Display;disp = Display().start();print(3);disp.stop()"
3