-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use subprocess instead of os.system #1477
Conversation
Master is now Python 3 only. This needs to be rebased, and compat for #1543 reverts the previous >>> shlex.split("C:\\path\\to\\exe /test other\\path")
['C:pathtoexe', '/test', 'otherpath']
>>> shlex.split("C:\\path\\to\\exe /test other\\path".replace("\\", "\\\\"))
['C:path\\to\\exe', '/test', 'other\\path']
>>> shlex.split("C:\\path\\to\\exe /test other\\path", posix=False)
['C:path\\to\\exe', '/test', 'other\\path'] Technically that last one with |
src/click/_termui_impl.py
Outdated
@@ -377,16 +378,16 @@ def pager(generator: t.Iterable[str], color: t.Optional[bool] = None) -> None: | |||
if os.environ.get("TERM") in ("dumb", "emacs"): | |||
return _nullpager(stdout, generator, color) | |||
if WIN or sys.platform.startswith("os2"): | |||
return _tempfilepager(generator, "more <", color) | |||
if hasattr(os, "system") and os.system("(less) 2>/dev/null") == 0: | |||
return _tempfilepager(generator, "more", color, pipe=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed _pipepager
exists now. Should we not use that instead here and remove the pipe
argument I introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that works as well, I'm usually in favor of avoiding new arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to test this on Windows and get this merged then.
51389d4
to
976f304
Compare
It seems that when Additionally, It seems to be that newline behaviour is different on GitHub's test runner however. On GitHub |
closes #1026, closes #1470, closes #1476