Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't run cmd.run with UTF-8 chars as arguments / parameters. With custom module. #48880
Description of Issue/Question
I'm trying to create a custom module because standard ones are not sufficient enought for managaging certain Windows management tastks.
But I can't run custom execution module to execute powershell with any Õ Ä Ö Ü character.
First I googled pyton ascii unicode a lot and tried unicode() encode() decode(), because I used str(name) and other variable verifications, but this has been futile because the last stripped down simple example showed me that the error is somewhere further than in my custom sls file.
Steps to Reproduce Issue
Sample file /srv/salt/_modules/str_aduser.py
Run with ASCII chars only..
This is an issue with python (especially py2) when shelling out to cmd or powershell. Python uses utf-8 where cmd is cp437 in English versions of Windows. We transitioned to using the PyWin32 modules for adding users in the