Skip to content

Unexpected interpreter crash #104086

Closed
Closed
@Eclips4

Description

@Eclips4

Originally taken from 104057
Minimal reproducible example:

import os


def make_bad_fd():
    file = open("test_file.txt", "wb")
    try:
        return file.fileno()
    finally:
        file.close()



fd = make_bad_fd()
os.write(fd, b"foo")

Error:

"Debug assertion Failed."
File minkernel/ctrs/ucrt/src/appcrt/lowio/write.cpp line 50, expression (_osfile(fh) & FOPEN)

Reproducible only on Windows and debug build of interpreter.
Is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions