Skip to content
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

[WinError 32] The process cannot access the file because it is being used by another process #33

Open
ArimanBlack opened this issue Aug 20, 2022 · 0 comments

Comments

@ArimanBlack
Copy link

The error appears on windows machines with python 3.10 installed because the code tries to a delete file while pillow still holds it's open.

src/twain.py:2048

Image.open(bmppath).save(filepath)
os.remove(bmppath)

change to:

                with Image.open(bmppath) as im:
                    im.save(filepath)
                    im.close()
                    os.remove(bmppath)

I tried to create a pull request for it but I don't have enough rights

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

1 participant