-
Notifications
You must be signed in to change notification settings - Fork 52
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
Exception getting new session: io.UnsupportedOperation: fileno #32
Comments
Could you post the exact error message when not using uvloop? uvloop isn't supported right now because the last time I tried there were some issues that I couldn't work around. |
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/arsenic/__init__.py", line 16, in __aenter__
self.session = await start_session(self.service, self.browser, self.bind)
File "/usr/local/lib/python3.6/dist-packages/arsenic/__init__.py", line 28, in start_session
driver = await service.start()
File "/usr/local/lib/python3.6/dist-packages/arsenic/services.py", line 99, in start
self.log_file
File "/usr/local/lib/python3.6/dist-packages/arsenic/services.py", line 34, in subprocess_based_service
process = await impl.start_process(cmd, log_file)
File "/usr/local/lib/python3.6/dist-packages/arsenic/subprocess.py", line 61, in start_process
stdin=DEVNULL,
File "/usr/lib/python3.6/asyncio/subprocess.py", line 225, in create_subprocess_exec
stderr=stderr, **kwds)
File "/usr/lib/python3.6/asyncio/base_events.py", line 1192, in subprocess_exec
bufsize, **kwargs)
File "/usr/lib/python3.6/asyncio/unix_events.py", line 200, in _make_subprocess_transport
**kwargs)
File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 39, in __init__
stderr=stderr, bufsize=bufsize, **kwargs)
File "/usr/lib/python3.6/asyncio/unix_events.py", line 706, in _start
universal_newlines=False, bufsize=bufsize, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 667, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "/usr/lib/python3.6/subprocess.py", line 1184, in _get_handles
c2pwrite = stdout.fileno()
io.UnsupportedOperation: fileno |
As a workaround, pass a |
I added
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/arsenic/__init__.py", line 16, in __aenter__
self.session = await start_session(self.service, self.browser, self.bind)
File "/usr/local/lib/python3.6/dist-packages/arsenic/__init__.py", line 29, in start_session
return await driver.new_session(browser, bind=bind)
File "/usr/local/lib/python3.6/dist-packages/arsenic/webdriver.py", line 57, in new_session
raise SessionStartError(err_resp['error'], err_resp.get('message', ''), original_response)
arsenic.errors.SessionStartError: unknown error: Process unexpectedly closed with status 1 Log file says I don't have display variable defined, but I'm using headless mode
My code: from arsenic import get_session, services, browsers
service = services.Geckodriver(log_file=open('file.txt','w'))
browser = browsers.Firefox(firefoxOptions={ 'args': ['-headless'] })
async with get_session(service, browser) as session:
await session.get('https://google.com') |
Looks like the options changed (either in FF or geckodriver). this worked for me: browser = browsers.Firefox(**{'moz:firefoxOptions': { 'args': ['-headless'] }}) |
New issue occurred. Log file output:
I'm able to get page with synchronous |
You ran out of RAM? (OOM = Out Of Memory) |
Yes, seems like previous firefox sessions remained in memory and ate it. Is this a bug?
After killing these I was able to navigate and get screenshot. Thanks for the support |
I don't know. I ran the code and it worked fine. Maybe it failed to clean up in the cases where it triggered one of the bugs/problems you ran into? I had to use docker since I don't have a native linux handy, so it cleaned up after each run. |
I managed to run session using uvloop setting |
Awesome! I'll try to add it as a fully supported loop then (with CI etc) |
Versions
OS: Ubuntu 18.04 LTS x86_64
Python: 3.6.5
firefox: 60.0.1
geckodriver 0.20.1
arsenic: 1.0.0.dev8
My code
Traceback
The text was updated successfully, but these errors were encountered: