[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser
Change by Kuang-che Wu : -- nosy: +kcwu ___ Python tracker <https://bugs.python.org/issue22401> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41320] async process closing after event loop closed
New submission from Kuang-che Wu : (following code is attached as well) import asyncio import time workaround = False async def slow_proc(): proc = await asyncio.create_subprocess_exec('sleep', '10', stdout=asyncio.subprocess.PIPE) try: return await proc.stdout.read() except asyncio.CancelledError: if workaround: proc.terminate() time.sleep(0.1) # hope the machine is not too busy async def func(): try: return await asyncio.wait_for(slow_proc(), timeout=0.1) except asyncio.TimeoutError: return 'timeout' def main(): while True: print('test') asyncio.run(func()) main() Run above code, it may work without error message (expected behavior). However, depends on timing, it may show warning/error messages case 1. Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1257652 is closed case 2. Exception ignored in: Traceback (most recent call last): File "/usr/lib/python3.8/asyncio/base_subprocess.py", line 126, in __del__ self.close() File "/usr/lib/python3.8/asyncio/base_subprocess.py", line 104, in close proto.pipe.close() File "/usr/lib/python3.8/asyncio/unix_events.py", line 536, in close self._close(None) File "/usr/lib/python3.8/asyncio/unix_events.py", line 560, in _close self._loop.call_soon(self._call_connection_lost, exc) File "/usr/lib/python3.8/asyncio/base_events.py", line 719, in call_soon self._check_closed() File "/usr/lib/python3.8/asyncio/base_events.py", line 508, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed Although running tasks will be cancelled when asyncio.run is finishing, subprocess' exit handler may be invoked after the event loop is closed. In above code, I provided a workaround. However it just mitigates the problem and not really fix the root cause. This is related to https://bugs.python.org/issue35539 p.s. My test environment is Debian 5.5.17 -- components: asyncio files: cancel_proc.py messages: 373799 nosy: asvetlov, kcwu, yselivanov priority: normal severity: normal status: open title: async process closing after event loop closed type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49321/cancel_proc.py ___ Python tracker <https://bugs.python.org/issue41320> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1759845] subprocess.call fails with unicode strings in command line
Kuang-che Wu added the comment: > I fail to see why subprocess.call(cmd.encode('whatever')) is not a general > solution. Because 'whatever' encoding doesn't exist. Assume cmd contains Japanese characters and my system is Chinese windows. subprocess.call expect the argument is encoded in mbcs, which is cp950. However, cp950 encoding doesn't contain Japanese characters. subprocess.call(cmd.encode('cp950')) will fail because cp950 doesn't contain Japanese characters. subprocess.call(cmd.encode('cp932')) will fail because subprocess.call will decode fail or incorrectly. -- ___ Python tracker <http://bugs.python.org/issue1759845> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7512] shutil.copystat may fail EOPNOTSUPP
New submission from Kuang-che Wu : "flags" is only supported on certain OS. FreeBSD is one of them. FreeBSD itself support chflags but not all of its file systems do. On FreeBSD, copystat() will fail on zfs. The exception is OSError and errno is EOPNOTSUPP. According to manpage chflags(2), the errno means "The underlying file system does not support file flags" If the file system doesn't support flags, we should not call os.chflags() at first or should not raise exception. In my patch, I just ignore EOPNOTSUPP exception. -- components: Library (Lib) files: copystat.diff keywords: patch messages: 96427 nosy: kcwu severity: normal status: open title: shutil.copystat may fail EOPNOTSUPP type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file15564/copystat.diff ___ Python tracker <http://bugs.python.org/issue7512> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1759845] subprocess.call fails with unicode strings in command line
Kuang-che Wu added the comment: There is slight difference between C and python patch. C version: convert mbcs argument to unicode py version: convert unicode argument to mbcs Actually, python version patch may not work if the string is unicode and cannot encoded by mbcs. For example, my windows system is Chinese (cp950) and the program I want to execute contains Japanese characters. Encode Japanese characters with mbcs (in this case, it is cp950) will fail. This is also what Matt (mclausch) said. On the other hand, the C version patch. I don't think fall-back is necessary. If the string is failed to convert from mbcs to unicode, it will be eventually failed inside CreateProcessA() because CreateProcessA internally (after win2k) will try to convert from mbcs to unicode and call CreateProcessW. -- ___ Python tracker <http://bugs.python.org/issue1759845> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1759845] subprocess.call fails with unicode strings in command line
Kuang-che Wu added the comment: ocrean-city's patch applied cleanly with trunk and it works for me. Could anybody review and commit? I could help if any refinement required. -- nosy: +kcwu ___ Python tracker <http://bugs.python.org/issue1759845> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1751245] Popen pipe file descriptor leak on OSError in init
Kuang-che Wu added the comment: this is duplicated to issue 5179 and is fixed in trunk -- nosy: +kcwu ___ Python tracker <http://bugs.python.org/issue1751245> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3541] bsddb memory leak on ubuntu
New submission from Kuang-che Wu <[EMAIL PROTECTED]>: On ubuntu, python 2.5.2. The memory usage of following program is increasing infinitly. There may be something leaking. However, it only consumes constant memory on windows (python 2.5.2). import bsddb d = bsddb.hashopen('a.db', 'c') d.close() while True: d = bsddb.hashopen('a.db') d.close() -- components: Extension Modules messages: 71013 nosy: kcwu severity: normal status: open title: bsddb memory leak on ubuntu type: resource usage versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3541> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2066] Adding new CNS11643, a *huge* charset, support in cjkcodecs
Kuang-che Wu added the comment: FYI, according to the new spec of cns11643-2004 (you can search the preview from http://www.cnsonline.com.tw/, at http://www.cnsonline.com.tw/preview/preview.jsp? general_no=1164300&language=C&pagecount=524). >From page 499, it mensioned an URL http://www.cnscode.org.tw/ and the version 3 mapping table could be found at http://www.cnscode.org.tw/cnscode/csic_ucs.jsp -- nosy: +kcwu __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2066> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1751245] Popen pipe file descriptor leak on OSError in init
Changes by Kuang-che Wu: Added file: http://bugs.python.org/file9407/diff-issue1751245.txt _ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1751245> _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2063] os.times() utime and stime exchanged on windows
New submission from Kuang-che Wu: According to document, os.times()[0] is process user time, [1] is system time. However this two value was implemented exchanged on windows. Python all versions have this issue. Attached patch is for trunk. -- components: Extension Modules, Windows files: diff-win-os-times.txt messages: 62274 nosy: kcwu severity: normal status: open title: os.times() utime and stime exchanged on windows type: behavior versions: Python 2.5, Python 2.6, Python 3.0 Added file: http://bugs.python.org/file9406/diff-win-os-times.txt __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2063> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com