You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If in the project template to update there is a symlink, the operation raises an OSError when calling the function _remove_paths in the cruft/_commands/utils/generate.py file.
cruft/_commands/update.py", line 78, in update deleted_paths=deleted_paths,cruft/_commands/utils/generate.py", line 47, in cookiecutter_template
_remove_paths(output_dir, skip_paths | deleted_paths)
cruft/_commands/utils/generate.py", line 119, in _remove_paths rmtree(path) File "/usr/lib/python3.6/shutil.py", line 490, in rmtree onerror(os.path.islink, path, sys.exc_info()) File "/usr/lib/python3.6/shutil.py", line 488, in rmtree raise OSError("Cannot call rmtree on a symbolic link")OSError: Cannot call rmtree on a symbolic link
Related Issue
To recreate the bug create a symlink in the new template version to upgrade and perform a cruft update ... over the old template.
How Has This Been Tested?
In order to fix the described behaviour, the following code is proposed in the PR associated with this issue. The changes made are in the cruft/_commands/utils/generate.py file and _remove_paths function:
The method unlink() in the path attribute has native support for symlinks but in the function code the case is not contemplated and is treated as a folder.
The text was updated successfully, but these errors were encountered:
Description
If in the project template to update there is a symlink, the operation raises an OSError when calling the function
_remove_paths
in thecruft/_commands/utils/generate.py
file.Related Issue
To recreate the bug create a symlink in the new template version to upgrade and perform a
cruft update ...
over the old template.How Has This Been Tested?
In order to fix the described behaviour, the following code is proposed in the PR associated with this issue. The changes made are in the
cruft/_commands/utils/generate.py
file and_remove_paths
function:The method
unlink()
in thepath
attribute has native support for symlinks but in the function code the case is not contemplated and is treated as a folder.The text was updated successfully, but these errors were encountered: