question-mark
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.

`run(('rm', '-rf', venv_path))` is worrisome

See original GitHub issue

run(('rm', '-rf', venv_path))

I was considering putting some checks around this line to ensure that we don’t delete something important, like /, or ., or ...

thoughts?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NorthIsUpcommented, Jan 29, 2015

I think a similar scenario would be very easy to imagine. The solution doesn’t need to be complicated either, a simple assert(path and path not in ('/', '.', '..')) would be sufficient.

0reactions
bukzorcommented, Feb 5, 2015

In that case, it force-removes an empty-string file, resulting in no change, unless you somehow had a file named empty-string. Actually, it would have to be a directory, since this is guarded by isdir. isdir('') is usually false.


>>> isdir('')
False
Read more comments on GitHub >

github_iconTop Results From Across the Web

Easiest way to rm -rf in Python - Stack Overflow
I was running into instances where API would fail and the directory was not deleted. The most robust approach I've found is: import...
Read more >
How to work with VS Code and Virtual Environments in Python
Then In VS Code, open the Command Palette (View > Command Palette or (Ctrl+Shift+P)). Then, select the Python: Select Interpreter command ...
Read more >
2018-December.txt - Python mailing list
I came home and tried to run a twitterscraper command in cmd ? without success. ... 1})")) rm -rf / CompletedProcess(args='echo rm -rf...
Read more >
How to delete virtual env? #3690 - python-poetry/poetry - GitHub
Run poetry env list (this will show you the venv for that project); Then run poetry env remove whatever-WhATeVs-py3.9 to delete it. Running...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found