certbot/certbot-ci
Adrien Ferrand 9cbb13ef04
Run hooks with Powershell on Windows (#7800)
Fixes #7713.

As discussed in #7713, providing a Powershell script as hook for Certbot is not working currently. This is because hooks are run in a `cmd` environment, that recognizes only `.bat` files as valid scripts that can be run from their bare name on command line.

On the other hand, the Powershell both `.bat` and `.ps1` scripts as valid scripts.

This PR makes hooks command be executed by Powershell, instead of `cmd` as `Popen` does by default when `shell=true` is used. It also modifies the tests to handle this new environment, in particular in term of encoding (UTF-16-LE is the default one in Powershell).

* Run hooks in powershell on Windows

* Fix hook test

* Fallback to unittest.mock

* In fact, shell_cmd as a list of str could not work. Declare only str as acceptable input for shell_cmd.

* Added changelog
2020-04-27 09:38:30 -07:00
..
certbot_integration_tests Run hooks with Powershell on Windows (#7800) 2020-04-27 09:38:30 -07:00
windows_installer_integration_tests Windows installer integration tests (#7724) 2020-02-05 14:12:29 -08:00
MANIFEST.in [Unix] Create a framework for certbot integration tests: PART 3g (#6953) 2019-04-15 17:39:38 -07:00
setup.py Drop Python 3.4 support (#7721) 2020-01-24 12:32:07 -08:00