Skip to content

Commit e0b2ac3

Browse files
authored
add powershell/cmd.exe specific cmds (#339)
1 parent 665c5a8 commit e0b2ac3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/code42cli/click_ext/groups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ def invoke(self, ctx):
103103

104104
except UnicodeEncodeError:
105105
if platform.system() == "Windows":
106-
cmd = '$ENV:PYTHONIOENCODING="utf-16"'
106+
cmd = 'if using powershell: $ENV:PYTHONIOENCODING="utf-16"\nif using cmd.exe: SET PYTHONIOENCODING="utf-16"'
107107
else:
108108
cmd = 'export PYTHONIOENCODING="utf-8"'
109109
raise Code42CLIError(
110-
f"Failed to handle unicode character using environment's detected encoding, try running:\n\n {cmd}\n\nand then re-run your `code42` command."
110+
f"Failed to handle unicode character using environment's detected encoding, try running the following:\n\n{cmd}\n\nand then re-run your `code42` command."
111111
)
112112

113113
except OSError:

0 commit comments

Comments
 (0)