Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shutil cleanup sometimes fails on python 3.8

See original GitHub issue

is this an upstream problem or would you be able to catch this? Our tests are marked as failures when this happens …

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.13/x64/bin/green", line 8, in <module>
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/green/", line 88, in main
    return _main(argv, testing)
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/", line 827, in __exit__
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/", line 831, in cleanup
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/", line 813, in _rmtree
    _shutil.rmtree(name, onerror=onerror)
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/", line 722, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/", line 720, in rmtree
OSError: [Errno 39] Directory not empty: '/tmp/tmpelefosle'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

WolfgangFahlcommented, Sep 21, 2022

@CleanCut excellent - since the CI picks up the latest green anyway we might see the warning sooner or later. If i spot in the logs I’ll let you know.

CleanCutcommented, Sep 20, 2022

Green 3.4.3 (just released) treats the inability to clean up a temp directory that it created as a warning instead of a crash…I hope. I couldn’t find a sane way to test this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry add/update/install can fail on Windows during temp ...
It can fail for a variety of reasons, but very commonly it's simply a process holding the file active for just a little...
Read more >
os.mkdir can fail with PermissionError after successful shutil ...
The problem seems to be in the Windows filesystem API functions (and not in the Python os module): deleted folders seem not to...
Read more >
Changelog — Python 3.8.14 documentation
bpo-42782: Fail fast in shutil.move() to avoid creating destination directories on failure. bpo-37193: Fixed memory leak in socketserver.ThreadingMixIn ...
Read more >
Changelog — Python 3.11.1 documentation
gh-83004: Clean up refleak on failed module initialisation in _io . gh-98897: Fix memory leak in math.dist() when both points don't have the ......
Read more >
List of issues - Python tracker -
1438480, 7 months ago, shutil.move raises OSError when copystat fails, has patch, open, piman. (no dependencies set) shutil_copytree_doc.patch.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found