psf / requests-html

Pythonic HTML Parsing for Humans™
http://html.python-requests.org
MIT License
13.73k stars 976 forks source link

OSError: Unable to remove Temporary User Data when running multiple sessions #164

Open testvinder opened 6 years ago

testvinder commented 6 years ago

If a start two scripts that both use render I quickly get errors such as this (only one of them fails and the other script continues):

2018-04-07 19:24:22,339 [67136] CRITICAL root: Traceback (most recent call last): File "filename.py", line 75, in rst = function_name(param=param) File "filename.py", line 53, in function_name session.close() File "C:\Users\testvinder\Envs\backend\lib\site-packages\requests_html.py", line 686, in close self.loop.run_until_complete(self._browser.close()) File "C:\Program Files\Python36\lib\asyncio\base_events.py", line 467, in run_until_complete return future.result() File "C:\Users\testvinder\Envs\backend\lib\site-packages\pyppeteer\browser.py", line 155, in close await self._closeCallback() # Launcher.killChrome() File "C:\Users\testvinder\Envs\backend\lib\site-packages\pyppeteer\launcher.py", line 201, in killChrome self._cleanup_tmp_user_data_dir() File "C:\Users\testvinder\Envs\backend\lib\site-packages\pyppeteer\launcher.py", line 130, in _cleanup_tmp_user_data_dir raise IOError('Unable to remove Temporary User Data') OSError: Unable to remove Temporary User Data

It seems that the two independent scripts interfere with each other and try to remove files belonging to the other process.

I'm using latest version of requests-html

oldani commented 5 years ago

Hi,

Could you please check if this still happens on version 0.10.0?

nittolese commented 5 years ago

Hey, same issue here. I'm using the .render() method in a script. I've updated the library but it keeps happen.

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Users\User\Anaconda3\envs\data-science\lib\site-packages\pyppeteer\launcher.py", line 262, in killChrome
    self._cleanup_tmp_user_data_dir()
  File "C:\Users\User\Anaconda3\envs\data-science\lib\site-packages\pyppeteer\launcher.py", line 154, in _cleanup_tmp_user_data_dir
    raise IOError('Unable to remove Temporary User Data')
OSError: Unable to remove Temporary User Data
machachen commented 4 years ago

Is there a quick fix for it? I'm facing the same issue when requesting too many times

Akshatt commented 3 years ago

Has anyone found the fix for this?