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

Temporary directory does not get removed #2090

Open
braggpeaks opened this issue Mar 8, 2024 · 1 comment
Open

Temporary directory does not get removed #2090

braggpeaks opened this issue Mar 8, 2024 · 1 comment
Labels
bug Existing features not working as expected

Comments

@braggpeaks
Copy link

weasyprint apparently creates a temporary directory but does not remove the directory afterwards.

Windows folder location: C:\Users\daniel.kellner\AppData\Local\Temp
Subfolder naming example: weasyprint-0qjsm58z

The folders are empty but I believe they should be removed to not leave unnecessary folders (I currently have 8000 of these weasyprint-* folders, don't ask 😂).

@liZe
Copy link
Member

liZe commented Mar 8, 2024

Hi!

The folders are supposed to be removed here, but:

  • It is not guaranteed that __del__() methods are called for objects that still exist when the interpreter exits (quoting the Python documentation), and
  • Windows likes to keep references to folders/files even when they’re not used anymore, preventing them to be deleted.

The "real" solution would be to only use data in memory (fonts are not that big). It should be possible to keep config files in memory thanks to FcConfigParseAndLoadFromMemory but there’s nothing to replace FcConfigAppFontAddFile.

If someone finds a better solution, I’ll be happy to try!

@liZe liZe added the bug Existing features not working as expected label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants