[issue33538] Remove useless check in subprocess
TaoQingyun <845767...@qq.com> added the comment: I can't find the reset code, could you give me a link? Thanks. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33538> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33538] Remove useless check in subprocess
New submission from TaoQingyun <845767...@qq.com>: diff --git a/Lib/subprocess.py b/Lib/subprocess.py index bafb501fcf..4a0bb33978 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -766,7 +766,7 @@ class Popen(object): ResourceWarning, source=self) # In case the child hasn't been waited on, check if it's done. self._internal_poll(_deadstate=_maxsize) -if self.returncode is None and _active is not None: +if self.returncode is None: # Child is still running, keep us alive until we can wait on it. _active.append(self) the `_active` is initialized with [] at the beginning of the module. -- components: Library (Lib) messages: 316804 nosy: qingyunha priority: normal severity: normal status: open title: Remove useless check in subprocess versions: Python 3.8 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33538> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32793] smtplib: duplicated debug message
New submission from TaoQingyun <845767...@qq.com>: ``` if self.debuglevel > 0: self._print_debug('connect:', (host, port)) ``` The above both in _get_socket and connect method, and connect also invoke _get_socket. -- components: Library (Lib) files: smtp.patch keywords: patch messages: 311818 nosy: qingyunha priority: normal severity: normal status: open title: smtplib: duplicated debug message versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47428/smtp.patch ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32793> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32358] json.dump: fp must be a text file object
New submission from TaoQingyun <845767...@qq.com>: ``` >>> import json >>> f = open('/tmp/t.json', 'wb') >>> json.dump(123, f) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/json/__init__.py", line 180, in dump fp.write(chunk) TypeError: a bytes-like object is required, not 'str' ``` This may not a bug. But it should mention at docs https://docs.python.org/3/library/json.html#json.dump -- components: Library (Lib) messages: 308517 nosy: qingyunha priority: normal severity: normal status: open title: json.dump: fp must be a text file object versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32358> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30862] parent logger should also check the level
TaoQingyun <845767...@qq.com> added the comment: Sorry to disturb. When calling `logging.basicConfig(level=logging.ERROR)`, I expect only the ERROR or above level will be logged. so the level argument if set should also pass to the handler. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue30862> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30862] parent logger should also check the level
TaoQingyun <845767...@qq.com> added the comment: Maybe I misunderstand. At least the basicConfig should also set the level of the handler that it created. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue30862> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31208] Simplify `low_fds_to_close` in subprocess.py
Changes by TaoQingyun <845767...@qq.com>: -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31208> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31216] Add ensure_ascii argument to json.tool
New submission from TaoQingyun: Sometimes I want this ``` $ echo -e '"\xe4\xbd\xa0\xe5\xa5\xbd"' | ./python -m json.tool --no-escape "你好" ``` not just ``` $ echo -e '"\xe4\xbd\xa0\xe5\xa5\xbd"' | ./python -m json.tool "\u4f60\u597d" ``` -- components: Library (Lib) files: jsontool.patch keywords: patch messages: 300327 nosy: qingyunha priority: normal severity: normal status: open title: Add ensure_ascii argument to json.tool type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file47083/jsontool.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31216> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31208] Simplify `low_fds_to_close` in subprocess.py
Changes by TaoQingyun <845767...@qq.com>: -- components: Library (Lib) files: subprocess.patch keywords: patch nosy: qingyunha priority: normal severity: normal status: open title: Simplify `low_fds_to_close` in subprocess.py type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file47082/subprocess.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31208> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30862] parent logger should also check the level
TaoQingyun added the comment: yes, I understand the effective level. my question is that before call ancestor's handler, should also check `c.isEnabledFor(record.levelno)` ``` def callHandlers(self, record): """ Pass a record to all relevant handlers. Loop through all handlers for this logger and its parents in the logger hierarchy. If no handler was found, output a one-off error message to sys.stderr. Stop searching up the hierarchy whenever a logger with the "propagate" attribute set to zero is found - that will be the last logger whose handlers are called. """ c = self found = 0 while c: for hdlr in c.handlers: found = found + 1 if record.levelno >= hdlr.level: hdlr.handle(record) if not c.propagate: c = None#break out else: c = c.parent ... ``` -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30862> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30862] parent logger should also check the level
New submission from TaoQingyun: ``` import logging logging.basicConfig(level=logging.ERROR) l = logging.getLogger("test") l.setLevel(logging.DEBUG) l.debug("Hello world") ``` it will print 'Hello world' -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30862> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30862] parent logger should also check the level
Changes by TaoQingyun <845767...@qq.com>: -- components: Library (Lib) nosy: qingyunha priority: normal severity: normal status: open title: parent logger should also check the level type: behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30862> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30240] Add daemon keyword argument to Thread constructor
Changes by TaoQingyun <845767...@qq.com>: -- versions: +Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30240> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30240] Add daemon keyword argument to Thread constructor
New submission from TaoQingyun: create a daemon thread like this, ``` t = Thread(target=f) t.daemon = True t.start() ``` I wonder the following code is better ``` Thread(target=f, daemon=True).start() ``` -- components: Library (Lib) messages: 292832 nosy: qingyunha priority: normal severity: normal status: open title: Add daemon keyword argument to Thread constructor type: behavior versions: Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30240> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com