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

TEE modifier does not work for python3 #185

Closed
gaschreiber opened this issue Mar 18, 2015 · 1 comment
Closed

TEE modifier does not work for python3 #185

gaschreiber opened this issue Mar 18, 2015 · 1 comment

Comments

@gaschreiber
Copy link

plumbum.commands.modifiers.TEE does not work for python3.
sys.stdout expects str type, but is given bytes.

When you change
plumbum.commands.modifiers.py:168
to
tee_to[fd].buffer.write(data)
it fixes the issue, but I'm not sure if this is clean, because of buffering.

@Semoar
Copy link
Contributor

Semoar commented Jun 27, 2015

For Python 3 it would be good. A problem is Python2, since back then there was no buffer.write(). Probably a conversion to string using tee_to[fd].write(data.decode('utf-8')) would be better.

I found out I also have to convert the return values from byte to str the same way.

Only thing I am not sure, if there isn't a better way than hardcoding utf-8...

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

No branches or pull requests

2 participants