Broker API HubMenu

Python exception

Python exception: BrokenPipeError

As text you can copy

BrokenPipeError
Kind
Exception
Where you meet it
Raised in your own program
Read from
Python 3 documentation, Built-in Exceptions, OS exceptions

What does BrokenPipeError mean in Python?

A subclass of ConnectionError, raised when trying to write on a pipe whose other end has been closed, or on a socket that has been shut down for writing. It corresponds to errno EPIPE and ESHUTDOWN.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Independent and unofficialdocs.python.orgchecked

What it means in trading API work

Your program tried to send on a connection that had already been closed, often one left idle for too long and then used again.

This part is this site's own explanation, written for people learning to call a trading API. It is not part of the source cited above and it describes no particular broker.

What should I do about BrokenPipeError?

Open a new connection and send again. For a long lived connection, send the keep alive message the API documents and reconnect when a write fails.

This page is an independent explanation in plain words. The definition itself is in the source it was read from, which is the authority if the two ever differ.