pypa / pypa/scripttest

TestFileEnvironment.clear fails on Windows

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
59
Forks
20
PR merge metrics
No merged PRs in 30d

Description

With scripttest 1.3, Python 2.7.8 win32.

When the test directory already exists, TestFileEnvironment.clear fails, with "WindowsError: [Error 5] Access is denied:" on the mkdir. It appears that Windows holds a lock on the path for a short time after rmtree returns. Adding time.sleep(0.001) after rmtree fixed the issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at TestFileEnvironment.clear and reproduce the failure on Windows when the test directory already exists, focusing on the sequence after rmtree and before mkdir. Confirm completion when clear no longer raises the reported Access denied error in the stated scripttest 1.3, Python 2.7.8 win32 environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.