-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
gh-150107: adding hasattr check on offset to include if available #150142
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
base: main
Are you sure you want to change the base?
Changes from all commits
a8f0c9c
7e7cba2
4a05d1a
6b5e93c
d2a9ce0
a11d3b3
4587db4
b525cb2
f247be0
84cdc6c
25ab08e
801932f
0679bcb
800a2d5
2af3015
027dec5
79857ff
ded4a36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -610,6 +610,9 @@ def sendfile(self, sock, file, offset, count): | |
| ov = _overlapped.Overlapped(NULL) | ||
| offset_low = offset & 0xffff_ffff | ||
| offset_high = (offset >> 32) & 0xffff_ffff | ||
| # TransmitFile ignores OVERLAPPED.Offset for handles not opened with | ||
| # FILE_FLAG_OVERLAPPED, so seek the CRT file pointer to match. | ||
| file.seek(offset) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vstinner this was an AI debugged and verified by me after the windows unit tests were crashing. Apparently the issue is that this function was essentially ignoring the offset being passed because we were not passing in OVERLAPPED.Offset. So |
||
| ov.TransmitFile(sock.fileno(), | ||
| msvcrt.get_osfhandle(file.fileno()), | ||
| offset_low, offset_high, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| :mod:`asyncio`: ``sendfile()`` and ``sock_sendfile()`` event loop methods | ||
| now call ``file.seek(offset)`` if *file* has a ``seek()`` method, | ||
| even if *offset* is ``0`` (default value). |
Uh oh!
There was an error while loading. Please reload this page.