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

Permission denied: 'xdg-settings' when executing 'jupyter notebook' from command line #85177

Closed
krishnasai2020 mannequin opened this issue Jun 17, 2020 · 10 comments
Closed
Labels
3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error

Comments

@krishnasai2020
Copy link
Mannequin

krishnasai2020 mannequin commented Jun 17, 2020

BPO 41005
Nosy @ronaldoussoren, @ned-deily, @miss-islington, @remilapeyre, @KrishnaSai2020
PRs
  • bpo-41005: Fixed perrmission error #20936
  • [3.9] bpo-41005: Fixed perrmission error (GH-20936) #21051
  • [3.8] bpo-41005: Fixed perrmission error (GH-20936) #21052
  • 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 = None
    closed_at = None
    created_at = <Date 2020-06-17.13:20:54.730>
    labels = ['type-bug', '3.7']
    title = "Permission denied: 'xdg-settings' when executing 'jupyter notebook' from command line"
    updated_at = <Date 2020-06-24.12:59:25.342>
    user = 'https://github.com/krishnasai2020'

    bugs.python.org fields:

    activity = <Date 2020-06-24.12:59:25.342>
    actor = 'ronaldoussoren'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2020-06-17.13:20:54.730>
    creator = 'SBC King'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41005
    keywords = ['patch']
    message_count = 9.0
    messages = ['371739', '371740', '371966', '371986', '371990', '371991', '372055', '372248', '372249']
    nosy_count = 6.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'python-dev', 'miss-islington', 'remi.lapeyre', 'SBC King']
    pr_nums = ['20936', '21051', '21052']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue41005'
    versions = ['Python 3.7']

    @krishnasai2020
    Copy link
    Mannequin Author

    krishnasai2020 mannequin commented Jun 17, 2020

    error was caused by the permission problem with 'xdg-settings'. I checked that Google Chrome is my default browser. I tried the following command by changing the c.NotebookApp.allow_root to True in the jupyter_notebook_config.py file, and it can successfully open jupyter notebook in the browser Safari:
    sudo jupyter notebook

    @krishnasai2020 krishnasai2020 mannequin added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Jun 17, 2020
    @krishnasai2020
    Copy link
    Mannequin Author

    krishnasai2020 mannequin commented Jun 17, 2020

    error was caused by the permission problem with 'xdg-settings'. I checked that Google Chrome is my default browser. I tried the following command by changing the c.NotebookApp.allow_root to True in the jupyter_notebook_config.py file, and it can successfully open jupyter notebook in the browser Safari:
    sudo jupyter notebook. this is just a workaround however.

    @remilapeyre
    Copy link
    Mannequin

    remilapeyre mannequin commented Jun 20, 2020

    Can you give more information about your issue here. This part of the code was written like this on purpose as the comment says:

        # OS X can use below Unix support (but we prefer using the OS X
        # specific stuff)
    

    We have to be sure that there is a bug here before changing the code, that changing the code will definitely fix the issue and that it won't create others.

    @krishnasai2020
    Copy link
    Mannequin Author

    krishnasai2020 mannequin commented Jun 21, 2020

    yeah there is a bug as web browsers won't open when you launch them from python code please have a look at this issue posted on jupyternotebook github : jupyter/notebook#3746 It was posted on the wrong place as it was not an issue with Jupiter but an issue with python.

    @ronaldoussoren
    Copy link
    Contributor

    I've commented on the attached PR.

    IMHO a correct fix is to catch and ignore PermissionError when calling xdg-settings (on all platforms). An xdg-settings executable that cannot be started due to permission problems is similar to that executable not being available at all.

    @krishnasai2020
    Copy link
    Mannequin Author

    krishnasai2020 mannequin commented Jun 21, 2020

    yeah I've updated the pr please review

    @ronaldoussoren
    Copy link
    Contributor

    New changeset 9e27bc0 by Krishna Chivukula in branch 'master':
    bpo-41005: Fixed perrmission error (GH-20936)
    9e27bc0

    @ronaldoussoren
    Copy link
    Contributor

    New changeset adf8708 by Miss Islington (bot) in branch '3.8':
    bpo-41005: Fixed perrmission error (GH-20936) (GH-21052)
    adf8708

    @ronaldoussoren
    Copy link
    Contributor

    New changeset d518ed0 by Miss Islington (bot) in branch '3.9':
    bpo-41005: Fixed perrmission error (GH-20936) (GH-21051)
    d518ed0

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @furkanonder
    Copy link
    Sponsor Contributor

    @ronaldoussoren The issue seems to be solved. We can close the issue.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants