Skip to content

PermissionError on Windows when using table_conversion='selenium' #93

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

Closed
Hyperz opened this issue Aug 22, 2023 · 1 comment
Closed

PermissionError on Windows when using table_conversion='selenium' #93

Hyperz opened this issue Aug 22, 2023 · 1 comment

Comments

@Hyperz
Copy link

Hyperz commented Aug 22, 2023

I have a Discord bot running on Windows 10 and Python 3.7 that periodically posts a dataframe image. I create the image using await asyncio.get_running_loop().run_in_executor(None, lambda: dataframe_image.export(df, filename, table_conversion='selenium')). This works fine, but after the 1st export errors start appearing when calling the export function again:

Exception ignored in: <finalize object at 0x2328bc85170; dead>
Traceback (most recent call last):
  File "C:\Development\Python37\lib\weakref.py", line 572, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
  File "C:\Development\Python37\lib\tempfile.py", line 795, in _cleanup
    _shutil.rmtree(name)
  File "C:\Development\Python37\lib\shutil.py", line 516, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Development\Python37\lib\shutil.py", line 400, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Development\Python37\lib\shutil.py", line 398, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\djete\\AppData\\Local\\Temp\\tmpa_fua6qj\\geckodriver.log'

The error doesn't cause any actual problems as far as I can tell, but still. Looking at the code I'm guessing it's due to temp_dir_obj never actually getting cleaned up in the SeleniumScreenshot class? I'm using dataframe-image==0.1.13.

@PaleNeutron
Copy link
Collaborator

Can you provide a piece of code for me to reproduce the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants