For what it’s worth, UTF-8 mode shouldn’t affect a normal print in a normal console. It will only affect streams redirected to files (in this context - it affects some other things, but not sys.stdout in a console).
It looks like you have some problem with Powershell parsing into the string literal and thinking that the semicolon is for it, rather than something it should just pass along to Python.
What does Get-Command python show? It seems like you aren’t invoking a normal executable. It might also be a bug in that version of PowerShell, so if there are any updates, it’s worth taking them just in case.
The “unexpected at this time” message is typically an error from cmd.exe. Could the python command actually be a .bat file that the user has somehow managed to install, rather than the standard Python executable?
Ah yes, you’re right (it’s been a while since I ran into it ). It’s probably a batch file that is processing some arguments, and so the quotes are being stripped off and not all of the arguments are being passed.
Get-Command python will show it (possibly (Get-Command python).Source if the path isn’t fully visible).
Yes, you are right. That is pywin-env. When I run just the executable it doesn’t do it. Probably pyenv bug. I didn’t think about this possiblity ( I am so used to that). Thanks everyone!