-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Iterates through each path from self._clean_trees to improve error ha… #58263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ndling with shutil.rmtree()
setup.py
Outdated
# Remove the directory tree at the specified path | ||
shutil.rmtree(path) | ||
except OSError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of iterating through clean_tree
, I would recommend reverting the changes done in #54236 (setup.py) which caused self._clean_trees
to be a list of generators.
EDIT: Using generator comprehension is intended, so you should probably fix the current logic of self._clean_trees
such that it is a list of paths (strings) and not generators.
self._clean_trees.extend(...)
instead of self_clean_trees.append(...)
should be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extend self._clean_trees
by converting generator to list using list comprehension
This finds all "pycache" directories in the current root
and appends their full paths to self._clean_trees
self._clean_trees.extend([os.path.join(root, dir) for dir in dirs if dir == "__pycache__"])
#and
self._clean_trees.extend([os.path.join(os.getcwd(), dir) for dir in ("build", "dist") if os.path.exists(dir)])
…error handling with shutil.rmtree()" This reverts commit 5535d85.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, but pandas is moving towards removing setup.py
in favor of building the library with meson #57941
If you are having trouble building pandas with setup.py
locally I would recommend making this change locally
Thanks for this PR but going to close |
setup.py
script, aTypeError
occurs in theshutil.rmtree()
function due to a generator being passed instead of a valid path. #58262 (Replace xxxx with the GitHub issue number)