We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use pyvirtualdisplay in a docker image to do scraping. After a time, I get the following error:
Traceback (most recent call last): File "/home/site/wwwroot/retriever/tools/browser_display.py", line 34, in start self._display.start() File "/usr/local/lib/python3.8/site-packages/pyvirtualdisplay/display.py", line 72, in start self._obj.start() File "/usr/local/lib/python3.8/site-packages/pyvirtualdisplay/abstractdisplay.py", line 149, in start self._start1_has_displayfd() File "/usr/local/lib/python3.8/site-packages/pyvirtualdisplay/abstractdisplay.py", line 197, in _start1_has_displayfd self.display = int(self._wait_for_pipe_text(rfd)) File "/usr/local/lib/python3.8/site-packages/pyvirtualdisplay/abstractdisplay.py", line 295, in _wait_for_pipe_text (rfd_changed_ls, _, _) = select.select([rfd], [], [], 0.1) ValueError: filedescriptor out of range in select()
The function select.select can only accept file descriptors below 1024. The solution is to use select.poll in place of select.select.
def _wait_for_pipe_text(self, rfd): s = "" poll = select.poll() poll.register(rfd, select.POLLIN) start_time = time.time() while True: rfd_changed_ls = poll.poll(0.1) if not self.is_alive(): poll.unregister(rfd) raise XStartError( "%s program closed. command: %s stderr: %s" % (self._program, self._command, self.stderr) ) if rfd_changed_ls: if rfd in rfd_changed_ls[0]: c = os.read(rfd, 1) if c == b"\n": break s += c.decode("ascii") # this timeout is for "eternal" hang. see #62 if time.time() - start_time >= self._timeout: poll.unregister(rfd) raise XStartTimeoutError( "No reply from program %s. command:%s" % ( self._program, self._command, ) ) poll.unregister(rfd) return s
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use pyvirtualdisplay in a docker image to do scraping.
After a time, I get the following error:
The function select.select can only accept file descriptors below 1024.
The solution is to use select.poll in place of select.select.
The text was updated successfully, but these errors were encountered: