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

Bugfix for dircheck() in Objects/fileobject.c #40201

Closed
uberning mannequin opened this issue Apr 29, 2004 · 3 comments
Closed

Bugfix for dircheck() in Objects/fileobject.c #40201

uberning mannequin opened this issue Apr 29, 2004 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@uberning
Copy link
Mannequin

uberning mannequin commented Apr 29, 2004

BPO 944928
Nosy @loewis, @birkenfeld
Files
  • fileobject.patch: Patch for Objects/fileobject.c
  • 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 = <Date 2005-09-15.13:16:55.000>
    created_at = <Date 2004-04-29.22:20:13.000>
    labels = ['interpreter-core', 'invalid']
    title = 'Bugfix for dircheck() in Objects/fileobject.c'
    updated_at = <Date 2005-09-15.13:16:55.000>
    user = 'https://bugs.python.org/uberning'

    bugs.python.org fields:

    activity = <Date 2005-09-15.13:16:55.000>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2004-04-29.22:20:13.000>
    creator = 'uberning'
    dependencies = []
    files = ['5953']
    hgrepos = []
    issue_num = 944928
    keywords = ['patch']
    message_count = 3.0
    messages = ['45887', '45888', '45889']
    nosy_count = 3.0
    nosy_names = ['loewis', 'georg.brandl', 'uberning']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue944928'
    versions = ['Python 2.3']

    @uberning
    Copy link
    Mannequin Author

    uberning mannequin commented Apr 29, 2004

    When the sys module is initialized in _PySys_Init(), it
    creates file objects for stdin, stdout and stderr with
    PyFile_FromFile() which calls fill_file_fields() to
    initialize the file object. At the end of
    initialization dircheck() is called, to ensure that the
    file is not a directory. If the underlaying file
    descriptors for stdin, stdout, stderr (0, 1, 2) are
    closed by the parent process, dircheck() fails at least
    on AIX. I don't know exactly why this fails but the
    following expression in dircheck()

    if (fstat(fileno(f->f_fp), &buf) == 0 &&
    S_ISDIR(buf.st_mode))

    evaluates to True for stdin which results in setting an
    exception and returning NULL to _PySys_Init().

    The applied patch changes dircheck() to return without
    further checks if the file object is for stdin, stdout
    or stderr.

    @uberning uberning mannequin closed this as completed Apr 29, 2004
    @uberning uberning mannequin added invalid interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Apr 29, 2004
    @uberning uberning mannequin closed this as completed Apr 29, 2004
    @uberning uberning mannequin added invalid interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Apr 29, 2004
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 18, 2004

    Logged In: YES
    user_id=21627

    This patch is not acceptable in this form. What you describe
    seems to point to a clear bug in AIX, and, as other AIX
    users have not reported that as a problem, appears to be
    specific to your installation. Maybe there is a problem with
    the compiler installation somehow?

    If you want to investigate this further, please try to
    reproduce the stat/ISDIR problem in a small stand-alone C
    program. If that succeeds, please generate an
    strace/ktrace/truss output for that binary.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    Closing due to lack of response and improbability of validity.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant