netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Donald Hunter <donald.hunter@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jan Stancek <jstancek@redhat.com>,
	donald.hunter@redhat.com
Subject: Re: [PATCH net-next v1] tools: ynl: handle broken pipe gracefully in CLI
Date: Thu, 8 May 2025 06:47:03 -0700	[thread overview]
Message-ID: <20250508064703.5d488277@kernel.org> (raw)
In-Reply-To: <20250508112102.63539-1-donald.hunter@gmail.com>

On Thu,  8 May 2025 12:21:02 +0100 Donald Hunter wrote:
> When sending YNL CLI output into a pipe, closing the pipe causes a
> BrokenPipeError. E.g. running the following and quitting less:
> 
> ./tools/net/ynl/pyynl/cli.py --family rt-link --dump getlink | less
> Traceback (most recent call last):
>   File "/home/donaldh/net-next/./tools/net/ynl/pyynl/cli.py", line 160, in <module>
>     main()
>     ~~~~^^
>   File "/home/donaldh/net-next/./tools/net/ynl/pyynl/cli.py", line 142, in main
>     output(reply)
>     ~~~~~~^^^^^^^
>   File "/home/donaldh/net-next/./tools/net/ynl/pyynl/cli.py", line 97, in output
>     pprint.PrettyPrinter().pprint(msg)
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
> [...]
> BrokenPipeError: [Errno 32] Broken pipe
> 
> Consolidate the try block for ops and notifications, and gracefully
> handle the BrokenPipeError by adding an exception handler to the
> consolidated try block.

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

  reply	other threads:[~2025-05-08 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08 11:21 [PATCH net-next v1] tools: ynl: handle broken pipe gracefully in CLI Donald Hunter
2025-05-08 13:47 ` Jakub Kicinski [this message]
2025-05-09 23:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250508064703.5d488277@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jstancek@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).