[issue32800] Replace deprecated link to new page on w3c site
Change by sblondon <stephane.blon...@gmail.com>: -- keywords: +patch pull_requests: +5419 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32800> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32800] Replace deprecated link to new page on w3c site
New submission from sblondon <stephane.blon...@gmail.com>: The documentation about namespace of ElemenTree (https://docs.python.org/3/library/xml.etree.elementtree.html#parsing-xml-with-namespaces) has a link for 'default namespace' to 'https://www.w3.org/TR/2006/REC-xml-names-20060816/#defaulting'. This page displays a big red message because the page is outdated. It can be replaced by the new one: https://www.w3.org/TR/xml-names/#defaulting The content of the paragraph in the new version is equivalent to the old one. I can provide a PR if you are interested. -- assignee: docs@python components: Documentation messages: 311837 nosy: docs@python, sblondon priority: normal severity: normal status: open title: Replace deprecated link to new page on w3c site type: enhancement ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32800> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32234] Add context management to mailbox.Mailbox
sblondon <stephane.blon...@gmail.com> added the comment: If the access is read-only, the lock is not required [1]. However, I agree it does not worth to be more complex (changing the signature of the subclass or adding another context manager for the lock). I updated the patch and documentation so the mailbox is locked at the __enter__(). 1: For example, the first source code example at https://docs.python.org/3/library/mailbox.html#examples -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32234> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32234] Add context management to mailbox.Mailbox
Change by sblondon <stephane.blon...@gmail.com>: -- keywords: +patch pull_requests: +4673 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32234> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32234] Add context management to mailbox.Mailbox
sblondon <stephane.blon...@gmail.com> added the comment: Currently, the implementation of .close() methods call flush() and unlock() if it's needed. About the ambiguity for the enter call, I think the context manager should provide access to Mailbox, not a lock. If a lock is needed, we could imagine another context manager: with mailbox.Mailbox as mbox: #read messages, ... with mbox.lock(): #actions that need lock Do you think it's better? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32234> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32234] Add context management to mailbox.Mailbox
New submission from sblondon <stephane.blon...@gmail.com>: mailbox.Mailbox has a .close() method that should be called at the end of Mailbox use. I think it would be nice to use Mailbox instances with a 'with' statement so .close() will be called it automatically. So there is no need to check for which format it's required (yes for mbox, no for Maildir, etc.) So the source code: mbox = mailbox.mbox("/path/to/mbox") ... mbox.close() could become: with mailbox.mbox("/path/to/mbox") as mbox: ... -- components: Library (Lib) messages: 307744 nosy: sblondon priority: normal severity: normal status: open title: Add context management to mailbox.Mailbox type: enhancement ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32234> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com