-
Notifications
You must be signed in to change notification settings - Fork 91
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
Cannot close os.pipe #473
Comments
Thanks for the report! The problem seems to be that os.pipe creates real file descriptors, which is okay, as we don't have to fake pipes, but os.close is implemented in the fake filesystem and doesn't know about real file descriptors. |
@saml - I added support for handling |
@mrbean-bremen I have another testcase related to multiprocessing that fails master. Would this be a new issue? Stacktrace is:
Test case is: def do_something(result_queue):
try:
with open('/tmp/abc/d.txt', 'w') as f:
pass # this line is test_bar.py", line 15 in the above stacktrace.
except Exception as err:
_log.exception('bad')
result_queue.put(err)
else:
result_queue.put()
def test_0(fs):
fs.create_dir('/tmp/abc/')
result_queue = multiprocessing.Queue()
p = multiprocessing.Process(target=do_something, args=(result_queue,))
p.start()
result = result_queue.get()
if result:
raise result
_log.info('result: %s', result)
p.join() |
Ah ok, I missed that - thanks. Will have a look later (and yes, this is the same issue). |
Hm, while the exception you encountered is due to a simple error I just fixed, I'm afraid that using multiprocessing may be problematic anyway. I just tested your example under Windows, and it failed due to the usage of Windows API access to the file system, which we cannot fake. I haven't looked at the unix implementation, but I'm afraid there will be similar problems that could only be resolved by patching |
@saml - did you get anywhere with that? |
Currently with master, running the same test case that involves multiprocessing hangs indefinitely (or until pytest timeout). |
Quick question, what's the state of multiprocessing support? I'm not quite clear given your last comment and that this bug is closed. |
Well, I had a quick look at the implementation of That being said, this is something that may need better documentation - there is currently only a small limitations chapter, that is probably not sufficient. I may have a go at adding a bit more information regarding problems like this one. |
@tomhey - I added a small chapter for this kind of problems. |
Describe the bug
File descriptor returned by
os.pipe()
cannot be closed:How To Reproduce
Using pytest:
Save above as
test_foobar.py
and run:Please provide a unit test or a minimal code snippet that reproduces the
problem.
Your enviroment
The text was updated successfully, but these errors were encountered: