wexpect icon indicating copy to clipboard operation
wexpect copied to clipboard

Add "encoding" and "codec_errors" arguments to "spawn"

Open EugeneLoy opened this issue 5 years ago • 2 comments

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.

EugeneLoy avatar Feb 16 '20 10:02 EugeneLoy

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))

raczben avatar Feb 20 '20 15:02 raczben

Similar to #47 and #48.

raczben avatar Feb 01 '21 08:02 raczben