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

pydoc error page due to lacking permissions on ./* #56905

Closed
gagern mannequin opened this issue Aug 5, 2011 · 5 comments
Closed

pydoc error page due to lacking permissions on ./* #56905

gagern mannequin opened this issue Aug 5, 2011 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@gagern
Copy link
Mannequin

gagern mannequin commented Aug 5, 2011

BPO 12696
Nosy @birkenfeld, @terryjreedy, @ned-deily, @ezio-melotti, @merwok
Superseder
  • bpo-7367: pkgutil.walk_packages fails on write-only directory in sys.path
  • 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 2011-10-07.06:23:23.113>
    created_at = <Date 2011-08-05.13:39:40.289>
    labels = ['type-bug', 'library']
    title = 'pydoc error page due to lacking permissions on ./*'
    updated_at = <Date 2011-10-07.06:23:23.112>
    user = 'https://bugs.python.org/gagern'

    bugs.python.org fields:

    activity = <Date 2011-10-07.06:23:23.112>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2011-10-07.06:23:23.113>
    closer = 'ned.deily'
    components = ['Library (Lib)']
    creation = <Date 2011-08-05.13:39:40.289>
    creator = 'gagern'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 12696
    keywords = []
    message_count = 5.0
    messages = ['141658', '141684', '141692', '141703', '145057']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'terry.reedy', 'gagern', 'ned.deily', 'ezio.melotti', 'eric.araujo']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '7367'
    type = 'behavior'
    url = 'https://bugs.python.org/issue12696'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @gagern
    Copy link
    Mannequin Author

    gagern mannequin commented Aug 5, 2011

    I'd like to be able to run "pydoc -b" in whatever directory I'm currently in. Most of the time that would be the root of my home directory, which is an ext4fs mount. So it has a subdirectory called "lost+found" for which I don't have any access permissions. As a result, the main pydoc info page will simply print an error message:

    OSError: [Errno 13] Permission denied: './lost+found'

    I'm not sure how best to address this. There are several possibilities that come to my mind:

    1. Provide a command line switch to strip '.' from sys.path.
    2. Skip any sys.path elements which cause exceptions, possibly
      printing a warning in addition to the remaining page content.
    3. Skip any single subdirectry which causes an exception,
      as this more closely models what importing by name would do.
    4. Explicitely skip lost+found, or perhaps any directory name which
      would be invalid as a module name.

    Obviously, the workaround is to change to a sufficiently empty directory before starting pydoc. So this is a minor issue, but annoying nevertheless.

    @gagern gagern mannequin added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Aug 5, 2011
    @terryjreedy
    Copy link
    Member

    Do any of you three have anything to do with pydoc?

    Given that the manual simply says "pydoc -b will start the server and additionally open a web browser to a module index page." without qualifications, quitting when started from certain locations strikes me as a bug. I do not see a reason to not just continue.

    @terryjreedy terryjreedy added type-bug An unexpected behavior, bug, or error and removed type-feature A feature request or enhancement labels Aug 5, 2011
    @gagern
    Copy link
    Mannequin Author

    gagern mannequin commented Aug 5, 2011

    The server continues all right. It's the browser window which displays the error message. Not much better in my opinion, though.

    To be completely accurate: currently the -b option doens't work as it should due to issue bpo-11432. But using "-p 0" and opening the link manually is a suitable workaround for now.

    @ned-deily
    Copy link
    Member

    This is essentially a duplicate of bpo-11914. The root cause is that pkgutil.iter_modules doesn't deal with permission errors when traversing paths. bpo-7367 is also related.

    @ned-deily ned-deily self-assigned this Aug 6, 2011
    @ned-deily
    Copy link
    Member

    This problem has been fixed with the changes for bpo-7367 and, for 2.7, bpo-7425. They should appear in 3.3.0, 3.2.3, and 2.7.3.

    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants