-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix spammy output from 'eden remove'(legacy Python cli)
Summary: ## Context The legacy Python version of Eden's remove function can produce excessive output when using Python versions greater than 3.11. This issue arises due to a change in [the function signature of _rmtree_safe_fd from shutil](https://github.com/python/cpython/blob/3.12/Lib/shutil.py#L642C1-L642C35). Previously, we integrated our spinner with `shutil.rmtree` in a hacky manner by decorating the inner functions and passing arguments to the spinner to print the path. However, due to the aforementioned signature change in Python 3.12, `args[0]` becomes too lengthy for printing. When this output wraps to a new line in the terminal, the `\r\033[K` trick fails to erase the text from the previous line, resulting in cluttered output. ## This Diff To address this issue, we have implemented a new strategy to parse the arguments based on the Python version in use. ## Note We are migrating to Rust version of this CLI command (`eden rm`) soon. Reviewed By: MichaelCuevas Differential Revision: D66888045 fbshipit-source-id: d7b654e0bdc3105eafc09ee426845c626a70ef92
- Loading branch information
1 parent
d9b15b0
commit 1788f4c
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters