Xvfb error while trying to open multiple xvfb screens in single python sessionSee original GitHub issue
- OS name: Ubuntu
- OS version: 20.04
- OS architecture: 64 bits
- Monitor 1: 1920x1080
- Python version: 3.8.10
- MSS version: 6.1.0
For GNU/Linux users:
- Display server protocol and version, if known: Xorg
- Desktop Environment: Gnome
- Composite Window Manager name and version: Not sure
Description of the warning/error
The error comes when I try to call mss.mss() in a single python session with two different Xvfb screens.
XIO: fatal IO error 0 (Success) on X server ":3" after 8 requests (8 known processed) with 0 events remaining.
Steps to reproduce:
from xvfbwrapper import Xvfb import mss import os xvfb = Xvfb(width=1920, height=1080, colordepth=24) xvfb.start() with mss.mss() as sct: pass xvfb.stop() xvfb = Xvfb(width=1920, height=1080, colordepth=24) xvfb.start() with mss.mss() as sct: pass
The error pops up exactly on this line
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Actually those internal details were added for performance and memory leak reasons. Your situation is not so frequent, so I would go with the new function to clear the internal state.
Could you try to reset that attribute before the second use of MSS?
from mss.linux import MSS # (...) xvfb.stop() MSS._display_dict.clear() xvfb = Xvfb(width=1920, height=1080, colordepth=24) # (...)