Skip to content
Back to top
View this page
Edit this page

# xonsh.procs.pipes

Pipe channel for single-owner fd management.

class xonsh.procs.pipes.PipeChannel(read_fd, write_fd)

  Single-owner pipe fd manager. Owner creates the pipe and is responsible for closing both ends. Consumers get non-owning wrappers via open_writer() / open_reader().

  classmethod from_pipe()

    Create a PipeChannel from os.pipe().

  classmethod from_pty()

    Create a PipeChannel from pty.openpty().

    Falls back to os.pipe() if PTY devices are exhausted.

  close()

    Close both ends.

  close_reader()

    Close the read end fd. Thread-safe and idempotent.

  close_writer()

    Close the write end fd. Thread-safe and idempotent.

  open_reader(mode='rb', buffering=-1)

    Non-owning file wrapper for the read end.

  open_writer(mode='wb', buffering=-1)

    Non-owning file wrapper for the write end.

  property read_fd
  property write_fd