-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
7 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
# SPDX-FileCopyrightText: 2022 Pietro Albini <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 DB Systel GmbH | ||
# SPDX-FileCopyrightText: 2023 Johannes Zarl-Zierl <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Matthias Riße | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
|
@@ -476,6 +477,10 @@ def _check_read(self, path: Path) -> None: | |
_("'{}' is not a directory").format(path) | ||
) | ||
return | ||
if not path.exists() and path.is_symlink(): | ||
# If the path is a broken symlink we can continue, allowing usage of | ||
# --force-dot-license even if the link target is not readable. | ||
return | ||
raise ArgumentTypeError(_("can't open '{}'").format(path)) | ||
|
||
def _check_write(self, path: Path) -> None: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
# SPDX-FileCopyrightText: 2022 Florian Snow <[email protected]> | ||
# SPDX-FileCopyrightText: 2022 Yaman Qalieh | ||
# SPDX-FileCopyrightText: 2022 Carmen Bianca Bakker <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Matthias Riße | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
|
@@ -392,7 +393,7 @@ def _is_uncommentable(path: Path) -> bool: | |
registered as an UncommentableCommentStyle. | ||
""" | ||
is_uncommentable = _get_comment_style(path) == UncommentableCommentStyle | ||
return is_uncommentable or is_binary(str(path)) | ||
return is_uncommentable or path.is_symlink() or is_binary(str(path)) | ||
|
||
|
||
def _verify_paths_line_handling( | ||
|