[issue38265] Update os.pread to accept the length type as size_t

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Or call pread() multiple times and concatenate results. -- ___ Python tracker ___ ___

[issue38265] Update os.pread to accept the length type as size_t

2019-09-25 Thread STINNER Victor
STINNER Victor added the comment: > Because this looks rather as a new feature than a bug fix. We don't add new > features in maintained versions. Oh ok. That's fair. I close the issue. The workaround is to use os.preadv() or other functions which accept size_t. -- resolution: ->

[issue38265] Update os.pread to accept the length type as size_t

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because this looks rather as a new feature than a bug fix. We don't add new features in maintained versions. Always there is a risk of introducing a regression. We don't know what bugs are contained in 64-bit size support on different platforms. I would

[issue38265] Update os.pread to accept the length type as size_t

2019-09-25 Thread STINNER Victor
STINNER Victor added the comment: Python 3.7 and 3.8 also have os.pread(). Why not also fixing these branches? -- os.pwrite() uses Py_buffer for its argument and supports size_t size. os.preadv() and os.pwritev() use internally the C structure "struct iovec" which uses size_t for its

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na
Dong-hee Na added the comment: Thank you @serhiy.storchaka and Kyle Stanley for the code review and approve. This issue is now solved. I close this issue. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ad7736faf5b82a24374c601a72599adf29951080 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359)

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +15940 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16359 ___ Python tracker ___

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na
Dong-hee Na added the comment: Linux: http://man7.org/linux/man-pages/man2/pread.2.html BSD: https://www.freebsd.org/cgi/man.cgi?pread(2) macOS: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/pread.2.html All of them pass the length as

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is okay. Just check that all platforms which support pread() (Linux, *BSD, macOS) pass the length as size_t instead of int. Windows does not always support length larger than 2 KiB, but it does not support pread() either. --

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na
Dong-hee Na added the comment: Oh okay! Thanks for letting me know. Is it okay to switch it into Py_ssize_t? -- ___ Python tracker ___

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Length should be Py_ssize_t. Python does not support creating bytes objects larger than PY_SSIZE_T_MAX. -- ___ Python tracker ___

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Dong-hee Na
New submission from Dong-hee Na : I've found this comments. // TODO length should be size_t! but Python doesn't support parsing size_t yet. (https://github.com/python/cpython/blob/279f44678c8b84a183f9eeb85e0b086228154497/Modules/posixmodule.c#L8830) I don't know when this comment was