sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

Bug: Exception on access to logfile when using VS Code AND PyCharm with Sourcery

Open CorvusGei opened this issue 3 years ago • 1 comments

Checklist

  • [x] I have searched the Sourcery documentation for the issue, and found nothing
  • [x] I have checked there are no open bugs referencing the same bug or problem

Description

PyCharm reports an IDE Internal Error. In the IDE Internal Errors window there are lots of Exceptions, all of them in Sourcery. Most of them show a PermissionError: [WinError 32] that it couldn't access 'C:\Users\myusername\AppData\Local\sourcery\sourcery.log', because it's used by another process. (I don't copy the exact error message, because my system is running in German language. I could reproduce the error because I have Sourcery installed in VS Code as well. The problem occurs only if I open VS Code first and PyCharm after it, Sourcery can't write to its log file, I think because it's being used by VS Code. If I open PyCharm first and VS Code after it, VS Code doesn't throw a visible Exception. So I think, this is a bug in the PyCharm-Plugin only. Maybe theres a solution for different logfile names for different IDEs?

Code snippet that reproduces issue

isn't code related

Debug Information

IDE Version: PyCharm 2022.2.4 (Community Edition) Build PC-222.4459.20

Sourcery Version: Sourcery 1.0.1

Operating system and Version: Windows Server 2019 Datacenter 1809 Virtual Machine

CorvusGei avatar Nov 28 '22 20:11 CorvusGei

Thanks for raising this! Definitely an issue.

Hellebore avatar Nov 30 '22 10:11 Hellebore