{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/pip/issues/6414","repository_url":"https://api.github.com/repos/pypa/pip","labels_url":"https://api.github.com/repos/pypa/pip/issues/6414/labels{/name}","comments_url":"https://api.github.com/repos/pypa/pip/issues/6414/comments","events_url":"https://api.github.com/repos/pypa/pip/issues/6414/events","html_url":"https://github.com/pypa/pip/issues/6414","id":433954067,"node_id":"MDU6SXNzdWU0MzM5NTQwNjc=","number":6414,"title":"message_about_scripts_not_on_PATH does not expanduser()","user":{"login":"jflorian","id":101996,"node_id":"MDQ6VXNlcjEwMTk5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/101996?v=4","gravatar_id":"","url":"https://api.github.com/users/jflorian","html_url":"https://github.com/jflorian","followers_url":"https://api.github.com/users/jflorian/followers","following_url":"https://api.github.com/users/jflorian/following{/other_user}","gists_url":"https://api.github.com/users/jflorian/gists{/gist_id}","starred_url":"https://api.github.com/users/jflorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jflorian/subscriptions","organizations_url":"https://api.github.com/users/jflorian/orgs","repos_url":"https://api.github.com/users/jflorian/repos","events_url":"https://api.github.com/users/jflorian/events{/privacy}","received_events_url":"https://api.github.com/users/jflorian/received_events","type":"User","site_admin":false},"labels":[{"id":924438096,"node_id":"MDU6TGFiZWw5MjQ0MzgwOTY=","url":"https://api.github.com/repos/pypa/pip/labels/triage","name":"triage","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-04-16T19:45:20Z","updated_at":"2019-06-20T00:11:19Z","closed_at":null,"author_association":"NONE","body":"**Environment**\r\n\r\n* pip version: 18.1\r\n* Python version: 3.7\r\n* OS: Fedora 29\r\n\r\nfrom python3-pip-18.1-1.fc29.noarch\r\n\r\n<!-- Feel free to add more information about your environment here -->\r\n\r\n**Description**\r\nI was trying to install [PyGitUp](https://github.com/msiemens/PyGitUp) with `pip3 install --user git-up` and ran into an [issue](https://github.com/msiemens/PyGitUp/issues/89) where I was warned:\r\n~~~\r\n  The script git-up is installed in '/home/jflorian/.local/bin' which is not on PATH.\r\n  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. \r\n~~~\r\nI callled BS because I knew this was on my PATH.  But then I noticed my PATH actually had `~/.local/bin` and not `/home/jflorian/.local/bin` as claimed.  I looked at `wheel.py` where the error originates and sure enough, there was no usage of `os.path.expanduser()`.  I changed my PATH to have this already expanded and the error message disappeared.                                                                            \r\n\r\n**Expected behavior**\r\nMost tools seem to know how to expand the tilde in my PATH, I would expect Pip to do so as well.\r\n\r\n**How to Reproduce**\r\n<!-- Describe the steps to reproduce this bug. -->\r\n\r\n1. export PATH with a local bin directory using a tilde, e.g., `~/.local/bin`\r\n2. Install any package with scripts using the `--user` option.\r\n3. Observe the technically correct warning, but which is misleading w/o serious thought because it must be taken very literally and not as most users are likely to understand.\r\n4. Repeat with PATH having the tilde already expanded, e.g., `/home/jflorian/.local/bin` and observe the behavior I'd expect in step 3.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pypa/pip/issues/comments/503790934","html_url":"https://github.com/pypa/pip/issues/6414#issuecomment-503790934","issue_url":"https://api.github.com/repos/pypa/pip/issues/6414","id":503790934,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMzc5MDkzNA==","user":{"login":"chrahunt","id":2312275,"node_id":"MDQ6VXNlcjIzMTIyNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/2312275?v=4","gravatar_id":"","url":"https://api.github.com/users/chrahunt","html_url":"https://github.com/chrahunt","followers_url":"https://api.github.com/users/chrahunt/followers","following_url":"https://api.github.com/users/chrahunt/following{/other_user}","gists_url":"https://api.github.com/users/chrahunt/gists{/gist_id}","starred_url":"https://api.github.com/users/chrahunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrahunt/subscriptions","organizations_url":"https://api.github.com/users/chrahunt/orgs","repos_url":"https://api.github.com/users/chrahunt/repos","events_url":"https://api.github.com/users/chrahunt/events{/privacy}","received_events_url":"https://api.github.com/users/chrahunt/received_events","type":"User","site_admin":false},"created_at":"2019-06-20T00:11:19Z","updated_at":"2019-06-20T00:11:19Z","author_association":"CONTRIBUTOR","body":"The purpose of this message is to help users identify why a particular script `scriptname` may not be available for execution as `scriptname` in their shell after installation of the containing package.\r\n\r\nI tested several shells and it appears that only `bash` expands a literal `~` in `PATH` by default (or at least with the default options on my machine).\r\n\r\n```\r\n$ cat test.sh\r\n#!/bin/sh\r\n\r\necho \"#!/bin/sh\r\necho found\r\n\" > ~/example\r\nchmod +x ~/example\r\n\r\nfor shell in /bin/bash /bin/zsh /usr/bin/fish /bin/csh /bin/dash /bin/ksh; do\r\n    echo \"$shell plain ~\"\r\n    HOME=~ PATH='~' $shell -c example\r\n    echo \"$shell expanded ~\"\r\n    HOME=~ PATH=~ $shell -c example\r\ndone\r\n$ ./test.sh\r\n/bin/bash plain ~\r\nfound\r\n/bin/bash expanded ~\r\nfound\r\n/bin/zsh plain ~\r\nzsh:1: command not found: example\r\n/bin/zsh expanded ~\r\nfound\r\n/usr/bin/fish plain ~\r\nfish: Unknown command 'example'\r\nfish:\r\nexample\r\n^\r\n/usr/bin/fish expanded ~\r\nfound\r\n/bin/csh plain ~\r\nexample: Command not found.\r\n/bin/csh expanded ~\r\nfound\r\n/bin/dash plain ~\r\n/bin/dash: 1: example: not found\r\n/bin/dash expanded ~\r\nfound\r\n/bin/ksh plain ~\r\n/bin/ksh: example: not found\r\n/bin/ksh expanded ~\r\nfound\r\n```\r\n\r\nVersions:\r\n\r\n```\r\nii  bash                                      4.4.18-2ubuntu1.1         amd64                     GNU Bourne Again SHell\r\nii  csh                                       20110502-3                amd64                     Shell with C-like syntax\r\nii  dash                                      0.5.8-2.10                amd64                     POSIX-compliant shell\r\nii  fish                                      2.7.1-3                   amd64                     friendly interactive shell\r\nii  ksh                                       93u+20120801-3.1ubuntu1   amd64                     Real, AT&T version of the Korn shell\r\nii  zsh                                       5.4.2-3ubuntu3.1          amd64                     shell with lots of features\r\n```\r\n\r\nAs a result, if `expanduser` was used here then bash users would not tell the difference, but users of any other shell would not get the benefit of the warning."}}
{"actor":{"display_login":"chrahunt"}}