豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

gh-113093: add parameter 'mode' in shelve.open#148662

Open
gmcrocetti wants to merge 1 commit intopython:mainfrom
gmcrocetti:gh-113093
Open

gh-113093: add parameter 'mode' in shelve.open#148662
gmcrocetti wants to merge 1 commit intopython:mainfrom
gmcrocetti:gh-113093

Conversation

@gmcrocetti
Copy link
Copy Markdown
Contributor

@gmcrocetti gmcrocetti commented Apr 17, 2026

add parameter 'mode' in shelve.open, letting users control file's type and access permissions

issue #113093


📚 Documentation preview 📚: https://cpython-previews--148662.org.readthedocs.build/

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot bot commented Apr 17, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@gmcrocetti gmcrocetti force-pushed the gh-113093 branch 4 times, most recently from d3b2b7a to ff64721 Compare April 17, 2026 14:24
@gmcrocetti gmcrocetti marked this pull request as ready for review April 17, 2026 15:02
@gmcrocetti gmcrocetti requested a review from AA-Turner as a code owner April 17, 2026 15:02
@picnixz

This comment has been minimized.

@picnixz
Copy link
Copy Markdown
Member

picnixz commented Apr 19, 2026

Ok nvm the issue is #113093

Comment thread Doc/library/shelve.rst
determine which accessed entries are mutable, nor which ones were actually
mutated).

The optional *mode* parameter controls the file mode (permissions) when creating
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the signature of the function and only refers to the default of dbm.open()

Comment thread Doc/library/shelve.rst Outdated
.. class:: DbfilenameShelf(filename, flag='c', protocol=None, \
writeback=False, *, serializer=None, \
deserializer=None)
writeback=False, mode=0o666, *, \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it a keyword-only.

Comment thread Doc/library/shelve.rst

Module :mod:`pickle`
Object serialization used by :mod:`!shelve`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.

Comment thread Doc/whatsnew/3.15.rst
* Add support for custom serialization and deserialization functions
in the :mod:`shelve` module.
(Contributed by Furkan Onder in :gh:`99631`.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kesp the new line

@gmcrocetti
Copy link
Copy Markdown
Contributor Author

Hello @picnixz , thanks for the careful review.
I addresses each one of your comments 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants