-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-29746: Update marshal docs to Python 3. #547
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
bpo-29746: Update marshal docs to Python 3. #547
Conversation
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kristjanvalur, @vsajip, @benjaminp, @birkenfeld and @tim-one to be potential reviewers. |
Doc/library/marshal.rst
Outdated
:func:`open` or :func:`os.popen`. It must be opened in binary mode (``'wb'`` | ||
or ``'w+b'``). | ||
file must be an open file object opened in binary mode (``'wb'`` or | ||
``'w+b'``). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it restricted to OS files and pipes? If BytesIO and custom objects are also supported, maybe use “binary file” from the glossary:
The file must be an open binary file object, for example as returned by open(. . ., 'wb').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think examples of open modes can be omitted. They are more specific for Python 2 (there is even special C API for FILE*
).
Python/marshal.c
Outdated
@@ -1810,8 +1809,8 @@ Functions:\n\ | |||
\n\ | |||
dump() -- write value to a file\n\ | |||
load() -- read value from a file\n\ | |||
dumps() -- write value to a string\n\ | |||
loads() -- read value from a string"); | |||
dumps() -- write value to a bytes object\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe “marshal value as a bytes object” or “convert value to a bytes object”. Writing to a bytes object sounds like you pass the bytes object in and it is modified.
(cherry picked from commit c611a5b)
(cherry picked from commit c611a5b)
Bumps [click](https://github.com/pallets/click) from 8.1.2 to 8.1.3. - [Release notes](https://github.com/pallets/click/releases) - [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst) - [Commits](pallets/click@8.1.2...8.1.3) --- updated-dependencies: - dependency-name: click dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
No description provided.