Skip to content

Commit

Permalink
Merge pull request #173 from raimon49/release-4.3.3
Browse files Browse the repository at this point in the history
Release 4.3.3
  • Loading branch information
raimon49 authored Sep 20, 2023
2 parents c1d5e6c + 985fbca commit 8a4b453
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## CHANGELOG

### 4.3.3

* Always terminate `--allow-only` and `--fail-on` messages with a newline
* Always terminate files created with `--output-file` with a newline

### 4.3.2

* Better handling extracting URLs from `Project-URL`
Expand Down
10 changes: 7 additions & 3 deletions piplicenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
open = open # allow monkey patching

__pkgname__ = "pip-licenses"
__version__ = "4.3.2"
__version__ = "4.3.3"
__author__ = "raimon"
__license__ = "MIT"
__summary__ = (
Expand Down Expand Up @@ -322,7 +322,7 @@ def get_python_sys_path(executable: str) -> list[str]:
if failed_licenses:
sys.stderr.write(
"fail-on license {} was found for package "
"{}:{}".format(
"{}:{}\n".format(
"; ".join(sorted(failed_licenses)),
pkg_info["name"],
pkg_info["version"],
Expand All @@ -337,7 +337,7 @@ def get_python_sys_path(executable: str) -> list[str]:
if len(uncommon_licenses) == len(license_names):
sys.stderr.write(
"license {} not in allow-only licenses was found"
" for package {}:{}".format(
" for package {}:{}\n".format(
"; ".join(sorted(uncommon_licenses)),
pkg_info["name"],
pkg_info["version"],
Expand Down Expand Up @@ -1079,6 +1079,10 @@ def save_if_needs(output_file: None | str, output_string: str) -> None:
try:
with open(output_file, "w", encoding="utf-8") as f:
f.write(output_string)
if not output_string.endswith("\n"):
# Always end output files with a new line
f.write("\n")

sys.stdout.write("created path: " + output_file + "\n")
sys.exit(0)
except IOError:
Expand Down

0 comments on commit 8a4b453

Please sign in to comment.