Skip to content

Tags: oconnor663/duct.py

Tags

1.0.1

Toggle 1.0.1's commit message
version 1.0.1

Changes since 1.0.0:
- `setup.py` has been replaced with `pyproject.toml`.
- Previously we used a global lock to avoid pipe inheritance race
  conditions on Windows. As of Python 3.7, `close_fds=True` is
  sufficient for this, and is also the default. The lock has been
  removed.

1.0.0

Toggle 1.0.0's commit message
version 1.0.0

Changes since 0.6.4:
- The majority of the API is stabilized as-is. The main visible change
  is that the `try_wait` methods on `Handle` and `ReaderHandle` have
  been renamed to `poll`, for consistency with `subprocess.Popen.poll`
  in the Python standard library. The `try_wait` methods are retained as
  `@deprecated` aliases. Apart from that renaming, the rest of the
  changes are bugfixes or edge case behaviors.
- Fixed a bug where `Handle.poll` could block indefinitely if a child
  process had exited but a longer-lived grandchild process was keeping
  its IO pipes open and its IO threads running (i.e. `stdin_bytes`,
  `stdout_capture`, or `stderr_capture`). Commit 60f57ae.
- `Handle.kill` and `ReaderHandle.kill` no longer wait on child
  processes to exit. `subprocess.Popen` has an undocumented `__del__`
  finalizer, and it lazily cleans up leaked zombie children whenever new
  child processes are spawned. That's sufficient to prevent unbounded
  leaks, and there are also edge cases where waiting on a killed process
  can still block, so Duct now relies entirely on that finalizer. I'm
  porting similar behavior to the Rust implementation, for its
  coordinated v1.0.0 release.
- Duct no longer kills child processes in any circumstance other than
  when you call `.kill()`. Previously Duct would kill child processes
  when closing a `ReaderHandle` that had not been read to EOF, or in
  some pipe spawning error cases.
- The `ReaderHandle.close` method no longer has any effect. Duct no
  longer defines the method, and `ReaderHandle` inherits the no-op
  `IOBase.close`. `ReaderHandle` is still compatible with the `with`
  keyword, but context exit no longer has any effect. The `with` keyword
  has been removed from docs examples, to avoid giving the impression
  that it can do prompt cleanup without relying on finalizers.

0.6.4

Toggle 0.6.4's commit message
version 0.6.4

Changes since 0.6.3:
- Fix a race condition where the kill() method would raise a
  ChildProcessError if the child exited before kill() was called. This
  was caused by a change in the behavior of Popen.send_signal() in
  Python 3.9. See commit 5dfae70.

0.6.3

Toggle 0.6.3's commit message
version 0.6.3

Changes since 0.6.2:
- Added `Handle.pids` and `ReaderHandle.pids`.

0.6.2

Toggle 0.6.2's commit message
version 0.6.2

Changes since 0.6.1:
- Added `ReaderHandle.try_wait`.

0.6.1

Toggle 0.6.1's commit message
version 0.6.1

Changes since 0.6.0:
- ReaderHandle now supports kill().
- Kill methods no longer wait on IO threads to complete. This avoids
  blocking on unkilled grandchildren.

0.6.0

Toggle 0.6.0's commit message
version 0.6.0

Changes since 0.5.1:
- Removed the `sh` function.
- Removed the `then` method.
- Add `Handle.kill` and use `waititd` to make it thread-safe.
- Add `ReaderHandle` and `Expression.reader()`.
- Avoid using threads in many cases.
- Rename stdin/stdout/stderr to stdin_path/stdout_path/stderr_path.
- Add Sphinx docs and doctest the examples.
- This will be the last major release supporting Python 2.

0.5.1

Toggle 0.5.1's commit message
bump version to 0.5.1

Changes since 0.5.0:
- Added `env_remove`.
- Automatically uppercase env var names on Windows.

0.5.0

Toggle 0.5.0's commit message
bump version to 0.5.0

Changes since 0.4.0:
- rename null_* and capture_* to *_null and *_capture
- split out stdin_file/stdout_file/stderr_file
- handle relative exe paths and dir
- add the start method
- make unchecked preserve the exit code

0.4.0

Toggle 0.4.0's commit message
bump version to 0.4.0

Changes since 0.3.0:
- The magic constants NULL/CAPTURE/STDOUT/STDERR have been replaced with
  dedicated methods: null_*/capture_*/stdout_to_stderr/stderr_to_stdout.
  This saves you the trouble of extra imports, and it avoids weird
  typechecking issues like .stdin(CAPTURE) (if that's supposed to be a
  type error, then would need need two different types for NULL).
- The env_remove and env_clear methods have been dropped, and we've gone
  back to the env/full_env API. (Though this time around they're methods
  instead of flags.) This is easier to use and more flexible, and it
  also prevents weird race conditions.
- The cwd method has been renamed to dir. The cmd and cwd names were too
  awkwardly close to each other.