Skip to content

Improve handling of encoding option - #926

Merged
sindresorhus merged 1 commit into
mainfrom
improve-encoding
Mar 24, 2024
Merged

sindresorhus merged 1 commit into
mainfrom
improve-encoding

Conversation

@ehmicky

@ehmicky ehmicky commented Mar 24, 2024

Copy link
Copy Markdown
Collaborator

Some of our logic changes based on whether the subprocess output is binary or not: the lines option, transforms, subprocess.readable(), subprocess.duplex() and subprocess.iterable().

We currently detect this by checking if the encoding option is buffer. However, if it is hex, it almost certainly also means the output is binary. The same applies to base64, base64url, latin1 and ascii (those last 2 are improperly named, they are actually ways to represent binary data in text form).

This PR fixes this.

It also improves the documentation and testing of the encoding option.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants