Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace unrecognised unicode characters rather than raising an exception #607

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

LewisGaul
Copy link
Collaborator

Fixes #606

Note that this still isn't ideal - if someone has a container expected to have output in an encoding other than unicode then special characters will all be replaced... It might be good to support the user passing encoding and errors through (much like subprocess.run()), but for now this seems like an improvement at least.

Copy link
Owner

@gabrieldemarmiesse gabrieldemarmiesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this looks okay, and I also agree that users should be able to pass the encoding they want. Also streaming the output to get raw bytes is also an option I believe and it already works with python-on-whales: https://gabrieldemarmiesse.github.io/python-on-whales/user_guide/docker_run/#stream-the-output

@LewisGaul LewisGaul merged commit 773725c into gabrieldemarmiesse:master Jul 10, 2024
37 checks passed
@LewisGaul LewisGaul deleted the non-unicode branch July 10, 2024 22:40
@LewisGaul
Copy link
Collaborator Author

I raised #608 to track the enhancement of allowing the user to specify encoding.

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.

UnicodeDecodeError getting container output
2 participants