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

file.closed returns False after the file is closed #380

Closed
codito opened this issue Apr 27, 2018 · 3 comments
Closed

file.closed returns False after the file is closed #380

codito opened this issue Apr 27, 2018 · 3 comments
Labels

Comments

@codito
Copy link

codito commented Apr 27, 2018

f.closed returns False after f.close() has been called.

With pyfakefs

f = open("/tmp/r.txt", "wb")
f.write(content)
f.close()
print("closed={}".format(f.closed))

# returns False

On real file system

> python
Python 3.6.5 (default, Apr 14 2018, 13:17:30)
[GCC 7.3.1 20180406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("/tmp/r.txt", "w")
>>> f.write("hello")
5
>>> f.close()
>>> f.closed
True
@mrbean-bremen
Copy link
Member

Thanks for the report - will have a look at it in the evening!

mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Apr 27, 2018
mrbean-bremen added a commit that referenced this issue Apr 27, 2018
@mrbean-bremen
Copy link
Member

Should be fixed in master now - please check!

@codito
Copy link
Author

codito commented Apr 28, 2018

Confirmed the fix. Thanks a lot!

@codito codito closed this as completed Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants