GoogleCloudPlatform / GoogleCloudPlatform/gsutil
gsutil --help crashed in python3 when trying to use a pager
- Dominant language
- Python
- Stars
- 918
- Forks
- 335
- PR merge metrics
- No merged PRs in 30d
Description
Repro Steps: `python3 gsutil.py --help` on a sufficiently small terminal (`tput lines` == 53)
Error:
```
Traceback (most recent call last):
File "gsutil.py", line 128, in
RunMain()
File "gsutil.py", line 124, in RunMain
sys.exit(gslib.__main__.main())
File "/home/davidmunro/proj/gsutil/gslib/__main__.py", line 315, in main
command_runner.RunNamedCommand('help')
File "/home/davidmunro/proj/gsutil/gslib/command_runner.py", line 411, in RunNamedCommand
return_code = command_inst.RunCommand()
File "/home/davidmunro/proj/gsutil/gslib/commands/help.py", line 173, in RunCommand
self._OutputHelp(''.join(output))
File "/home/davidmunro/proj/gsutil/gslib/commands/help.py", line 201, in _OutputHelp
Popen(pager, stdin=PIPE).communicate(input=help_str)
File "/usr/lib/python3.6/subprocess.py", line 828, in communicate
self._stdin_write(input)
File "/usr/lib/python3.6/subprocess.py", line 781, in _stdin_write
self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'
```
The same command using python2 works fine.
Contributor guide
Assessment
This issue has not been assessed yet.