Skip to content

os.remove on Windows could fail if files are still in use #535

Closed

Description

@leofang

This code

try: # noqa: SIM105
os.remove(f)
except FileNotFoundError:
pass # noqa: SIM105

could fail on Windows if the module is still loaded (and therefore the module file is in use):

On Windows, attempting to remove a file that is in use causes an exception to be raised

https://docs.python.org/3/library/os.html#os.remove

As per suggestion by @rwgk we should move cleanup code from test shutdown to test setup time.

Activity

  1. added
    cuda.coreEverything related to the cuda.core module
    P1Medium priority - Should do
    testImprovements or additions to tests
    on Mar 25, 2025
  2. added this to the cuda.core beta 4 milestone on Mar 25, 2025
  3. added a commit that references this issue on Apr 10, 2025
    2616c8d
  4. assigned
    and
    rwgk
    and unassigned on Jun 3, 2025
  5. moved this from Todo to Done in CCCLon Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1Medium priority - Should docuda.coreEverything related to the cuda.core moduletestImprovements or additions to tests

Type

No type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions