Fix typo in pwrite documentation#3933
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
There was a problem hiding this comment.
Can you please document that the function returns the number of written bytes?
Example from os.write doc: "Return the number of bytes actually written."
There was a problem hiding this comment.
I prefer os.write() phrasing: "Write the bytestring in str to file descriptor fd (...), so please keep the parameter name "str".
There was a problem hiding this comment.
Actually, I do not agree with this statement. Maybe it's just a wording, but for me, speaking about str(ing) suppose we are dealing with NULL terminated buffer.
Finally, if we decide to go in favour of keeping str, then should the following be changed as well ?
.. function:: pread(fd, buffersize, offset)
Read from a file descriptor, *fd*, at a position of *offset*. It will read up
to *buffersize* number of bytes. The file offset remains unchanged.
Availability: Unix.
There was a problem hiding this comment.
Actually, I do not agree with this statement. Maybe it's just a wording, but for me, speaking about str(ing) suppose we are dealing with NULL terminated buffer.
It's the documentation of Python. In Python, it's perfectly fine to have NUL bytes in bytes strings and NUL characters in str strings. If you dislike "str" parameter name, please update the write() documentation as well.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be poked with soft cushions! |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @Haypo: please review the changes made to this pull request. |
|
Another example of write() documentation: https://docs.python.org/dev/library/io.html#io.RawIOBase.write This one says "Write the given bytes-like object, b, to the underlying raw stream" and the parameter is just called "b". |
|
Thanks for your contribution @nabilbendafi. Sadly for this PR, this sentense has already been rewrorded in #7254. |
Documentation is not in line with code
Modules/clinic/posixmodule.c.h