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

type error with Python3 in terminal.show_pager #7

Closed
edmw opened this issue Dec 21, 2015 · 2 comments
Closed

type error with Python3 in terminal.show_pager #7

edmw opened this issue Dec 21, 2015 · 2 comments

Comments

@edmw
Copy link

edmw commented Dec 21, 2015

I get a type error when calling terminal.show_pager with Python3.5

>>> from humanfriendly import terminal
>>> terminal.show_pager("1 2 3")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mib/tmp/python-humanfriendly/humanfriendly/terminal.py", line 392, in show_pager
    pager.communicate(input=formatted_text)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 1053, in communicate

    self._stdin_write(input)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 1015, in _stdin_write
    self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'
xolox added a commit that referenced this issue Sep 28, 2016
xolox added a commit that referenced this issue Sep 28, 2016
@xolox xolox closed this as completed in b864e89 Sep 28, 2016
@xolox
Copy link
Owner

xolox commented Sep 28, 2016

Hi Michael, thanks for the feedback and sorry not picking this up this earlier. I added a test which indeed breaks on Python 3 builds and then tested the solution. I've since released version 1.44.8 which contains the fix.

edmw pushed a commit to edmw/python-app that referenced this issue Mar 1, 2017
@edmw
Copy link
Author

edmw commented Mar 1, 2017

Thanks

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