Duplicate file is closed when original file is closed · Issue #1212 · IronLanguages/ironpython3 (original) (raw)

@slozier

Description

@slozier

slozier

opened

on May 8, 2021

From IronLanguages/ironpython2#92:

import os

with open("temp.txt", "wb+") as f: f.write(b"test") f.seek(os.SEEK_SET, 0) x = os.dup(f.fileno()) g = os.fdopen(x, "rb")

assert g.read() == b"test"

fails with:

io.UnsupportedOperation: File not open for reading

Metadata

Metadata

Assignees

No one assigned

Labels

No labels

No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions