-
-
Notifications
You must be signed in to change notification settings - Fork 32k
test_asyncio: test_sendfile failed on ReFS, Windows 11 Dev Drive #111347
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
Comments
Thanks for the bug report. Do you think you can submit a PR to fix it? It should at least be backported to 3.12 and probably also to 3.11, but start on main, please. |
Yes, if I submit a PR, I would prefer to remove the line. I will do it later. |
Windows is different.
Windows is different.
Bug report
Bug description:
The full name of the failed test case is:
Test output:
Based on my comprehension, I re-wrote and simplified the test case, as shown below.
Output:
loop = asyncio.SelectorEventLoop()
loop = asyncio.SelectorEventLoop()
loop = asyncio.ProactorEventLoop()
loop = asyncio.ProactorEventLoop()
Because
file.tell()
is0
, the test case fails. However, even though the test case passes on NTFS, it does not mean correctness.I guess that the main purpose of test_sendfile.py:473 is to check the number of bytes sent by the client. When
SelectorEventLoop
is used on Windows, Python will firstly trysendfile
syscall, which will fail, and then fallback to_sendfile_fallback
, which uses POSIX-read function in a loop. After each read, the file offset is sure to increase.When
ProactorEventLoop
is used on Windows, Python will calltransmitFile
function. However, this function does not tell us how it will modify the file offset. In fact, on NTFS,file.tell()
is 32768, but at least 98304 bytes have been sent and received.In conclusion, the statement on test_sendfile.py:473 does not work on Windows. Either another method needs to be found to check the number of bytes sent, or the line needs to be removed (test_sendfile.py:471 may be enough, I think).
Windows Version: 22631.2500 with Windows Feature Experience Pack 1000.22677.1000.0
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: