Skip to content

Conversation

@denini08
Copy link
Contributor

@denini08 denini08 commented Aug 7, 2025

Hello. While running the tests on Windows, I encountered a PermissionError caused by how tempfile.NamedTemporaryFile behaves on this platform. On Windows, temporary files created with NamedTemporaryFile cannot be reopened while still open, unlike on Unix-based systems.

To make the test portable across platforms, I modified the fixture to:

  • Use delete=False so the file can be reopened.
  • Close the file before using it in the test.
  • Explicitly delete the file after the test finishes.

This ensure the test works consistently on both Windows and Linux/macOS.

@davidsbatista
Copy link
Owner

Hi @denini08! Thanks for this 👍🏽

@davidsbatista davidsbatista merged commit cb87d24 into davidsbatista:master Aug 23, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants