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

Add support for bytes in init_text arg of stdio_mgr #36

Open
bskinn opened this issue Aug 5, 2019 · 2 comments
Open

Add support for bytes in init_text arg of stdio_mgr #36

bskinn opened this issue Aug 5, 2019 · 2 comments
Labels
enhancement New feature or request maybe This may or may not be implemented
Milestone

Comments

@bskinn
Copy link
Owner

bskinn commented Aug 5, 2019

jayvdb:

(That also needed binary init_text so it cant adopt stdio-mgr quite yet)

Certain use-cases will benefit from stdio_mgr taking either str or bytes in the init_text argument.

@bskinn bskinn added enhancement New feature or request maybe This may or may not be implemented labels Aug 5, 2019
@bskinn bskinn added this to the Future milestone Aug 5, 2019
@bskinn
Copy link
Owner Author

bskinn commented Aug 25, 2019

@jayvdb I figure part of the challenge here is dealing with the encoding... is part of it also having to change the type of the output between str and bytes depending on the type of the content passed to init_text?

I.e., StdioManager.stdout should be made to be of the same type (& encoding, if relevant) as init_text?

@jayvdb
Copy link
Contributor

jayvdb commented Aug 26, 2019

It isnt hard to change the code. Writing the tests is however quite a bit of work.

The main problem was that the attr checks on init_text would need to be weakened to allow bytes or str, and I have been looking to avoid that, because I find that any time bytes or str are allowed, people make mistakes and they end up reporting weird errors stemming from the mistake.

#64 should get us on the path to using different classes for bytes (e.g. class names can include Raw or Bytes for those versions), or adding class methods, to handle different types with proper type checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maybe This may or may not be implemented
Projects
Development

No branches or pull requests

2 participants