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

Duplicate file is closed when original file is closed #92

Open
slide opened this issue Jun 9, 2017 · 0 comments
Open

Duplicate file is closed when original file is closed #92

slide opened this issue Jun 9, 2017 · 0 comments

Comments

@slide
Copy link
Contributor

slide commented Jun 9, 2017

From @slozier on October 30, 2016 23:58

This works with CPython. IronPython fails with ValueError: I/O operation on closed file.

import os

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

Copied from original issue: IronLanguages/main#1512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants