Skip to content

os.isdir() should contain skiplinks=False in arguments #57180

Closed as not planned
Closed as not planned

Description

@socketpair
BPO 12971
Nosy @larryhastings, @giampaolo, @socketpair

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 2011-09-13.13:23:57.945>
labels = ['type-feature', 'library']
title = 'os.isdir() should contain skiplinks=False in arguments'
updated_at = <Date 2014-01-31.22:59:21.450>
user = 'https://github.com/socketpair'

bugs.python.org fields:

activity = <Date 2014-01-31.22:59:21.450>
actor = 'yselivanov'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2011-09-13.13:23:57.945>
creator = 'socketpair'
dependencies = []
files = []
hgrepos = []
issue_num = 12971
keywords = []
message_count = 4.0
messages = ['143968', '164116', '164131', '164140']
nosy_count = 4.0
nosy_names = ['larry', 'giampaolo.rodola', 'socketpair', 'alexey-smirnov']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue12971'
versions = ['Python 3.5']

Activity

  1. socketpair commented on Sep 13, 2011

    socketpairmannequin
    MannequinAuthor

    When skiplinks is False (by default), it should as in current implementation, i.e. using stat().

    if skiplinks is True, isidr() should use lstat() and same logick.

    If one will be implemented, os.walk() should be patched (see bpo-12970) to use this new isdir() with this new parameter instead of own logick in os.walk().

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on Sep 13, 2011
  3. larryhastings commented on Jun 27, 2012

    @larryhastings
    Contributor

    If this happens, in keeping with the new os module aesthetic, I suggest the prototype should be

    os.isdir(path, *, follow_symlinks=True)
  4. socketpair commented on Jun 27, 2012

    socketpairmannequin
    MannequinAuthor

    Отправлено с iPad

    27.06.2012, в 6:03, Larry Hastings <report@bugs.python.org> написал(а):

    No, follow symlinks is not the same.

    Skiplinks mean returning true or false depending on fact that last path element is symlink.
    Checking If symlink appear in the middle of the path, this is not issue of this feature request.

    ----------
    nosy: +larry


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue12971\>


  5. larryhastings commented on Jun 27, 2012

    @larryhastings
    Contributor

    First: there's no chance this will go into 3.1, 3.2, or 3.3 at this point.

    Second: I can assure you that switching to the l... version of a function and not following the last symlink is exactly what "follow_symlinks" is for. Please see the 3.3 documentation on follow_symlinks for more:

    http://docs.python.org/3.3/library/os.html#follow-symlinks

    Third: I think it's better to keep os.isdir() simple. Users who want more sophisticated use cases (what to do about symlinks, using a dir_fd parameter) should use os.stat(). So I'm -1 on this.

    TBH I'm not sure this even warrants a documentation change ("for more functionality, use os.stat()").

  6. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions