Executor

Latest version: v23.1

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 18

23.1

----------------------------

As requested in `issue 2`_: Enable control over the spinner that's
shown when a command pool is active. For more details refer to the
:attr:`.CommandPool.spinner` documentation.

.. _Release 23.1: https://github.com/xolox/python-executor/compare/23.0...23.1
.. _issue 2: https://github.com/xolox/python-executor/issues/2

23.0

----------------------------

This release includes two notable changes:

**Improved compatibility of release discovery**
As reported in `issue 17`_ official Debian Docker images don't include the
file ``/etc/lsb-release`` nor the program :man:`lsb_release` and this breaks
"release discovery" using the :attr:`.distributor_id` and
:attr:`.distribution_codename` properties. This has been fixed by implementing
a fall back that tries to parse the ``/etc/apt/sources.list`` file to
determine the package mirror URL which is matched against the mirror URLs in
:data:`.MIRROR_TO_DISTRIB_MAPPING`.

.. note:: Because this concerns a fall back the risk of regressions is small.

**Fixed Unicode inconsistency on Python 2.7**
It turns out that while :func:`shlex.split()` on Python 2.7 accepts Unicode
strings it doesn't actually support them: The result is a list of byte strings
and any values that ASCII doesn't support result in an error.

This caused the values (but not the keys) in the dictionary provided by
:attr:`.lsb_release_variables` to become byte strings which in turn caused
:attr:`.distributor_id` and :attr:`.distribution_codename` to become byte
strings (when those properties are based on :attr:`.lsb_release_variables`).

However when :attr:`.distributor_id` and :attr:`.distribution_codename` are
based on the output of the :man:`lsb_release` program the values become
Unicode strings, so this unfortunate behavior of :func:`shlex.split()` was
causing rather inconsistent behavior in the :pypi:`executor` package.

This has been fixed by applying a workaround on Python 2.7 (the text is
encoded before passing it to :func:`shlex.split()` and the result is decoded
before use).

.. note:: While this concerns a small detail in the grand scheme of things it
is technically backwards incompatible and version numbers are cheap,
hence why this is being released as 23.0.

.. _Release 23.0: https://github.com/xolox/python-executor/compare/22.0...23.0
.. _issue 17: https://github.com/xolox/python-executor/issues/17

22.0

----------------------------

Maintenance release that changes the compatible Python versions.

**Noteworthy changes:**

- Documented support for Python 3.8.

- Dropped support for Python 2.6 and 3.4.

- Avoid cyclic dependencies in the :mod:`executor.tcp` module. I've been
working on readying a new project for publication and started using the
:class:`~executor.tcp.EphemeralTCPServer` class in its test suite, however I
ran into an unnecessary cyclic dependency that caused :mod:`logging` to print
dramatic tracebacks (although nothing actually failed):

- The ``__init__()`` method needed access to the ephemeral TCP port (because
it is passed to the command that's started) which implies running a whole
lot of code (to pick a port that isn't in use yet) and this code logged
``EphemeralTCPServer.__str__()``.

- This was intended to use ``WaitUntilConnected.__str__()`` however due to
incorrect superclass ordering it called ``ExternalCommand.__str__()``
instead which needs access to the ``command`` property which in turn
requires ``__init__()`` to have already been run!

- This catch-22 was broken by removing the ``__str__()`` from logging and
using a newly added :attr:`~executor.tcp.WaitUntilConnected.endpoint`
property instead (explicit is better than implicit).

**Miscellaneous changes:**

- Bumped :pypi:`humanfriendly` to 8.0 and :pypi:`property-manager` to 3.0 to
fix deprecated imports and resolve a backwards incompatibility in the test
suite (introduced by the :pypi:`humanfriendly` 8.0 release).

- Changed ``Makefile`` to use Python 3 during development.

- Improved the :man:`ionice` tests.

.. _Release 22.0: https://github.com/xolox/python-executor/compare/21.3...22.0

21.3

----------------------------

Merged pull request `16`_ that changes the :man:`ionice` integration to
accept the strings '1', '2' and '3' in addition to 'idle', 'best-effort'
and 'realtime' because :man:`busybox` doesn't support the verbose strings.

It's still up to the caller to pick the right kind of value and I'm a bit
conflicted about that because it's creating a leaky abstraction. I may at a
later point decide to add automatic translation from the verbose labels to the
numeric codes (which seem to be the lowest common denominator that's always
supported) ...

.. _Release 21.3: https://github.com/xolox/python-executor/compare/21.2...21.3
.. _16: https://github.com/xolox/python-executor/pull/16

21.2

----------------------------

Enable ``context.read_file(..., sudo=True)`` and ``context.write_file(...,
sudo=True)``. In fact all optional keyword arguments are supported (not just
:man:`sudo`) but for me the most important one is ``sudo=True`` because I strongly
prefer "selective :man:`sudo`" over "just run everything using :man:`sudo`".

.. _Release 21.2: https://github.com/xolox/python-executor/compare/21.1.1...21.2

21.1.1

------------------------------

Bug fix of sorts: Guard against binary data in ``/etc/lsb-release`` on Travis
CI. This problem became apparent after `10`_ triggered some new development.
Since then I created `15`_ to track this specific issue.

.. _Release 21.1.1: https://github.com/xolox/python-executor/compare/21.1...21.1.1
.. _15: https://github.com/xolox/python-executor/issues/10

Page 1 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.