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
Fix issue with homebrew-installed nc taking precedence in $PATH #12366
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,12 @@ | |
raise TypeError('unsupported proxy protocol: "{}"'.format(parsed.scheme)) | ||
|
||
def make_argv(): | ||
yield "nc" | ||
if sys.platform in {'linux', 'cygwin'}: | ||
if sys.platform == 'darwin': | ||
# 'nc' in $PATH may be installed by homebrew, if without path | ||
yield "/usr/bin/nc" | ||
else: | ||
yield "nc" | ||
if sys.platform in {'linux', 'cygwin', 'darwin'}: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. plz split to a new pr, a pull request should only handle one thing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /usr/bin/nc is the BSD version pre-installed in macos, which need need use the same config as linux and cygwin. Therefore, it's all about addressing the issue of macOS not being ready to use out of the box. |
||
# caveats: the built-in netcat of most linux distributions and cygwin support proxy type | ||
# caveats: macOS built-in netcat command not supported proxy-type | ||
yield "-X" # --proxy-type | ||
|
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.
hardcoded paths are bad code.
References
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.
/usr/bin/nc is the BSD version pre-installed in MacOS,If users need to configure the system using SHELLPROXY_NETCAT_PROGRAM, then it might require debugging to identify the issue.