Skip to content

Commit

Permalink
Emit export errors to stderr to prevent invalid output
Browse files Browse the repository at this point in the history
An error in export could emit error messages to stdout, causing the requirements.txt output to stdout to be invalid.

Fixes python-poetry#4109
  • Loading branch information
colindean committed May 26, 2021
1 parent 4ec09d4 commit a6d003a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions poetry/console/commands/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def handle(self) -> None:

locker = self.poetry.locker
if not locker.is_locked():
self.line("<comment>The lock file does not exist. Locking.</comment>")
self.line_error("<comment>The lock file does not exist. Locking.</comment>")
options = []
if self.io.is_debug():
options.append(("-vvv", None))
Expand All @@ -53,7 +53,7 @@ def handle(self) -> None:
self.call("lock", " ".join(options))

if not locker.is_fresh():
self.line(
self.line_error(
"<warning>"
"Warning: The lock file is not up to date with "
"the latest changes in pyproject.toml. "
Expand Down

0 comments on commit a6d003a

Please sign in to comment.