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

Mac installer shell updater script silently fails if default shell is fish #73262

Closed
elias6 mannequin opened this issue Dec 26, 2016 · 15 comments
Closed

Mac installer shell updater script silently fails if default shell is fish #73262

elias6 mannequin opened this issue Dec 26, 2016 · 15 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes OS-mac topic-installation type-bug An unexpected behavior, bug, or error

Comments

@elias6
Copy link
Mannequin

elias6 mannequin commented Dec 26, 2016

BPO 29076
Nosy @ronaldoussoren, @ned-deily, @elias6, @miss-islington, @erlend-aasland
PRs
  • bpo-29076: Add fish support to macOS installer #23302
  • [3.9] bpo-29076: Add fish support to macOS installer (GH-23302) #23937
  • [3.8] bpo-29076: Add fish support to macOS installer (GH-23302) #23938
  • Files
  • 0001-bpo-29076-Add-fish-support-to-macOS-build.patch: 0001-bpo-29076-Add-fish-support-to-macOS-build.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ned-deily'
    closed_at = <Date 2021-01-28.14:56:00.716>
    created_at = <Date 2016-12-26.18:46:40.698>
    labels = ['OS-mac', 'type-bug', 'expert-installation', '3.9', '3.10', '3.8']
    title = 'Mac installer shell updater script silently fails if default shell is fish'
    updated_at = <Date 2021-01-28.14:56:00.715>
    user = 'https://github.com/elias6'

    bugs.python.org fields:

    activity = <Date 2021-01-28.14:56:00.715>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2021-01-28.14:56:00.716>
    closer = 'ned.deily'
    components = ['Installation', 'macOS']
    creation = <Date 2016-12-26.18:46:40.698>
    creator = 'elias'
    dependencies = []
    files = ['48929']
    hgrepos = []
    issue_num = 29076
    keywords = ['patch']
    message_count = 15.0
    messages = ['284036', '284041', '284049', '284050', '284052', '284053', '284054', '284586', '362879', '381008', '381021', '383733', '385867', '385868', '385869']
    nosy_count = 5.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'elias', 'miss-islington', 'erlendaasland']
    pr_nums = ['23302', '23937', '23938']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29076'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @elias6
    Copy link
    Mannequin Author

    elias6 mannequin commented Dec 26, 2016

    I have a Mac running OS X 10.11.6, Python 3.5.2, and fish 2.3.1. I installed Python 3.6.0, and everything seemed to work fine. However, I typed "python3" in my shell and it started Python 3.5.2.

    I restarted my shell and typed "python3", and it still started Python 3.5.2. I ran "which python3" and it told me "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3".

    I ran "echo $PATH" and it told me "/Library/Frameworks/Python.framework/Versions/3.5/bin", among other directories that seem unrelated to Python.

    I thought that maybe the installer updated my ~/.bash_profile, assuming that I am using bash like most people, but I looked in that file, and the only things affecting my path that look Python-related are adding the directories "/Library/Frameworks/Python.framework/Versions/2.7/bin" and "/Library/Frameworks/Python.framework/Versions/3.5/bin".

    I re-ran the installer, clicked the "Customize" button, made sure that the "Shell profile updater" checkbox was checked, and ran "python3", and it started Python 3.5.2.

    I can probably fix this by adding the right directory to my $PATH, but I think it is a bug if the installer doesn't make that change for me, or even try to make the change.

    @elias6 elias6 mannequin added topic-installation OS-mac type-bug An unexpected behavior, bug, or error labels Dec 26, 2016
    @ned-deily ned-deily self-assigned this Dec 26, 2016
    @ned-deily
    Copy link
    Member

    Can you check what the permissions and ownership are on your existing .bash_profile file? Also, as you suspected, the installer's profile updater script does not currently look for fish initialization files.

    @elias6
    Copy link
    Mannequin Author

    elias6 mannequin commented Dec 26, 2016

    I just ran "ls -l ~/.bash_profile" and got the following output:

    -rw-r--r--+ 1 Elias staff 1057 Jul 2 11:04 /Users/Elias/.bash_profile

    @ned-deily
    Copy link
    Member

    Thanks for the info. The '+' is the ls output indicates there is extended security information for .bash_profile, probably an access control list entry that affects it. I suspect that might be the reason that .bash_profile does not get updated by the installer script; it seems to work for me but there are certainly a lot of different configurations the script has to deal with. Try "ls -le .bash_profile'.

    @elias6
    Copy link
    Mannequin Author

    elias6 mannequin commented Dec 26, 2016

    I just ran "ls -le ~/.bash_profile" and got this result:

    -rw-r--r--+ 1 Elias staff 1057 Jul 2 11:04 /Users/Elias/.bash_profile
    0: user:_spotlight inherited allow read,execute,readattr,readextattr,readsecurity

    @ned-deily
    Copy link
    Member

    OK, that shouldn't be an issue. I'm just guessing at this point since nothing has changed in the profile updater script in a long time over many releases. I'm assuming you are running the installer under the same user name (Elias) and that Elias is an admin user. Fortunately, you can run the script manually since a copy is installed in /Applications/Python 3.6. Try double-clicking on the "Update Shell Profile.command" file there and see what shows up in the ensuing terminal window. If it now works, try restoring the original file:

    mv ~/.bash_profile.pysave ~/.bash_profile

    and rerun the installer and, and before quitting the installer, checking the installer log output (CMD-L and then selecting the all messages option) for clues.

    @ned-deily
    Copy link
    Member

    Ah! If you have made "fish" your default shell, the updater script should fail with the message "Sorry, I don't know how to patch ... shells". Perhaps your default shell was still bash back when you previously installed Python 3.5 and 2.7? If so, then the issue is simply that the updater script doesn't support fish.

    @terryjreedy terryjreedy changed the title Python 3.6 installer doesn't update "python3" shell command Py 3.6 Mac installer doesn't update "python3" shell command Dec 31, 2016
    @elias6
    Copy link
    Mannequin Author

    elias6 mannequin commented Jan 3, 2017

    Ned, that sounds plausible. I think I started using fish after I installed Python 3.5, but before I installed Python 3.6.

    @ned-deily ned-deily added the 3.7 (EOL) end of life label Mar 3, 2017
    @ned-deily ned-deily changed the title Py 3.6 Mac installer doesn't update "python3" shell command Mac installer shell updater script silently fails if default shell is fish Mar 3, 2017
    @erlend-aasland
    Copy link
    Contributor

    I've created a patch that applies fine to 3.7, 3.8 and 3.9, if anyone still is interested.

    (Backporting to 3.6 and 2.7 is probably not going to happen, but at least the patch applies fine to both of them.)

    The "Versions" label list should probably be updated to include 3.8 and 3.9.

    @ronaldoussoren
    Copy link
    Contributor

    @erland: The attached patch looks fine to me. Could you convert it to a PR?

    @ronaldoussoren ronaldoussoren added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes and removed 3.7 (EOL) end of life labels Nov 15, 2020
    @erlend-aasland
    Copy link
    Contributor

    Sure, I'll create a PR right away.

    @miss-islington
    Copy link
    Contributor

    New changeset 7f162e8 by Erlend Egeberg Aasland in branch 'master':
    bpo-29076: Add fish support to macOS installer (GH-23302)
    7f162e8

    @ned-deily
    Copy link
    Member

    New changeset e9c6c26 by Miss Islington (bot) in branch '3.9':
    bpo-29076: Add fish support to macOS installer (GH-23302) (GH-23937)
    e9c6c26

    @ned-deily
    Copy link
    Member

    New changeset 81b23a9 by Miss Islington (bot) in branch '3.8':
    bpo-29076: Add fish support to macOS installer (GH-23302) (GH-23938)
    81b23a9

    @ned-deily
    Copy link
    Member

    Thanks for the PR!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes OS-mac topic-installation type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants