wexpect
wexpect copied to clipboard
Add "encoding" and "codec_errors" arguments to "spawn"
Is your feature request related to a problem? Please describe.
I am trying to add windows support to my project and encoding-related args of spawn
are not implemented.
To be specific, encoding
and codec_errors
are not implemented. I experienced this with WEXPECT_SPAWN_CLASS=SpawnSocket
, probably true with other spawn classes.
Describe the solution you'd like
encoding
and codec_errors
arguments of spawn
should be added and behave as in pexpect
.
Can you express a specific use-case when you need these arguments?
I ask, because wexpect uses strings only*. The root-cause is that the ReadConsoleOutputCharacter returns python str
not byte-string** see related part of wexpect. This is why I cannot see any reason for encoding. Whole wexpect project (the searchers, reader, writer functions) works with strings
So please describe your use-case.
*((SpawnSocket
uses byte-string, but this is another topic))
**((More precisely PyUnicode))
Similar to #47 and #48.