[issue45924] Incorrect traceback when future's exception is raised multiple times
Change by lilydjwg : -- nosy: +lilydjwg ___ Python tracker <https://bugs.python.org/issue45924> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45671] str(CancelledError()) is empty
lilydjwg added the comment: OK, I see. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue45671> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45671] str(CancelledError()) is empty
lilydjwg added the comment: Oh, I find that many exceptions return an empty string when created without any arguments, but most raised ones do have a descriptive error message. Yes, if it's going to change, we'd change all of them. But now I doubt if it's worth the effort... What if we change so that if the exception were going to return an empty string, it returns the class name instead? -- ___ Python tracker <https://bugs.python.org/issue45671> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45671] str(CancelledError()) is empty
New submission from lilydjwg : When I try to print an asyncio.CancelledError object, I do not see it and I thought something went wrong. CancelledError inherits from BaseException and all BaseException subclasses (e.g. SystemExit, KeyboardInterrupted) seem to return empty strings for str(e). While I never tried to print SystemExit or KeyboardInterrupted, I did try to print an CancelledError. It doesn't have a lot information but all other exceptions I tried to print return something so I expect CancelledError to be the same. I know repr(e). I was just lazy and I expect Python to not be confusing even I'm lazy. -- components: asyncio messages: 405318 nosy: asvetlov, lilydjwg, yselivanov priority: normal severity: normal status: open title: str(CancelledError()) is empty type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue45671> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42682] awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks
New submission from lilydjwg : import asyncio async def crash(key): raise Exception('crash!') async def wait(fu): await fu async def main(): crasher = asyncio.create_task(crash(())) fs = [wait(crasher) for _ in range(10)] for fu in asyncio.as_completed(fs): try: await fu except Exception: import traceback traceback.print_exc() if __name__ == '__main__': asyncio.run(main()) This code will give a very long traceback 10 times. I expect it to be short. I'm caching the result of an async function like this: async def get( self, key: Hashable, func: Callable[[Hashable], Coroutine[Any, Any, Any]], ) -> Any: async with self.lock: cached = self.cache.get(key) if cached is None: coro = func(key) fu = asyncio.create_task(coro) self.cache[key] = fu if asyncio.isfuture(cached): # pending return await cached # type: ignore elif cached is not None: # cached return cached else: # not cached r = await fu self.cache[key] = r return r It works fine, except that when there is an exception the traceback is very long. -- components: asyncio messages: 383364 nosy: asvetlov, lilydjwg, yselivanov priority: normal severity: normal status: open title: awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue42682> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc
Change by lilydjwg : -- nosy: +lilydjwg ___ Python tracker <https://bugs.python.org/issue41105> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37095] [Feature Request]: Add zstd support in tarfile
Change by lilydjwg : -- nosy: +lilydjwg ___ Python tracker <https://bugs.python.org/issue37095> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does
Change by lilydjwg : -- keywords: +patch pull_requests: +13527 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13628 ___ Python tracker <https://bugs.python.org/issue35246> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does
lilydjwg added the comment: > All we need is `program = os.fspath(program)` in base_events.py > subprocess_exec() method. I don't think so. The arguments could be `pathlib.Path` too. We can update the `isinstance(arg, (str, bytes))` check so the args pass on to `subprocess.Popen`. It will work in the POSIX part but there is an issue (issue33617, issue31961) in Windows part: subprocess.list2cmdline doesn't accept pathlib.Path. -- ___ Python tracker <https://bugs.python.org/issue35246> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34506] Traceback logged when SSL handshake fails
Change by lilydjwg : -- nosy: +lilydjwg ___ Python tracker <https://bugs.python.org/issue34506> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35246] asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does
New submission from lilydjwg : When I pass pathlib.Path to asyncio.create_subprocess_exec I get: TypeError: program arguments must be a bytes or text string, not PosixPath It's not so good when subprocess accepts this kind of arguments without issues. So can you add support for this? -- components: asyncio messages: 329907 nosy: asvetlov, lilydjwg, yselivanov priority: normal severity: normal status: open title: asyncio.create_subprocess_exec doesn't accept pathlib.Path like subprocess does type: enhancement versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue35246> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35144] TemporaryDirectory clean-up fails with unsearchable directories
lilydjwg added the comment: Yes issue26660 is similar but not the same. On Windows it seems a read-only file cannot be deleted while on Linux a file resident in a non-searchable directory cannot be deleted. An onerror for TemporaryDirectory will work. Also I'd like to add an optional dir_fd argument for onerror. -- ___ Python tracker <https://bugs.python.org/issue35144> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35144] TemporaryDirectory can't be cleaned up if there are unsearchable directories
New submission from lilydjwg : If the title doesn't explain clearly, here's a demo program that will fail: import tempfile import pathlib def test(): with tempfile.TemporaryDirectory(prefix='test-bad-') as tmpdir: tmpdir = pathlib.Path(tmpdir) subdir = tmpdir / 'sub' subdir.mkdir() with open(subdir / 'file', 'w'): pass subdir.chmod(0o600) if __name__ == '__main__': test() I didn't expect this, and I didn't find an easy way to handle this except not using TemporaryDirectory at all: import tempfile import pathlib import shutil import os def rmtree_error(func, path, excinfo): if isinstance(excinfo[1], PermissionError): os.chmod(os.path.dirname(path), 0o700) os.unlink(path) print(func, path, excinfo) def test(): tmpdir = tempfile.mkdtemp(prefix='test-good-') try: tmpdir = pathlib.Path(tmpdir) subdir = tmpdir / 'sub' subdir.mkdir() with open(subdir / 'file', 'w'): pass subdir.chmod(0o600) finally: shutil.rmtree(tmpdir, onerror=rmtree_error) if __name__ == '__main__': test() This works around the issue, but the dirfd is missing in the onerror callback. I have this issue because my program extracts tarballs to a temporary directory for examination. I expected that TemporaryDirectory cleaned up things when it could. What do you think? rm -rf can't remove such a directory either but this is annoying and I think Python can do better. -- components: Library (Lib) messages: 329116 nosy: lilydjwg priority: normal severity: normal status: open title: TemporaryDirectory can't be cleaned up if there are unsearchable directories type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue35144> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27650] Implement `__repr__` methods for logging.Logger and others
lilydjwg added the comment: This hangs this test from celery: https://github.com/celery/celery/blob/master/t/unit/app/test_log.py#L72 It constructs a Logger with `.parent` to itself, making getEffectiveLevel loop forever. The code tries to raise an exception when such loops are detected, but its message contains the logger's repr which calls getEffectiveLevel. -- nosy: +lilydjwg ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27650> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28565] datetime.strptime %Z doesn't get included in the result
New submission from lilydjwg: With %z, the result gets a tzinfo, but with %Z, it succeeds but the result is without timezone info: >>> datetime.datetime.strptime('2016-10-31T03:58:24 CST', '%Y-%m-%dT%H:%M:%S >>> %Z') datetime.datetime(2016, 10, 31, 3, 58, 24) >>> datetime.datetime.strptime('2016-10-31T03:58:24 +0800', '%Y-%m-%dT%H:%M:%S >>> %z') datetime.datetime(2016, 10, 31, 3, 58, 24, tzinfo=datetime.timezone(datetime.timedelta(0, 28800))) So the first one loses infomation (and will result in wrong values if the programmer isn't aware of this, and the local timezone is different than the one in the string). -- messages: 279761 nosy: lilydjwg priority: normal severity: normal status: open title: datetime.strptime %Z doesn't get included in the result type: behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28565> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain
lilydjwg added the comment: I understand now, thank you! It's much easier to work around such issues than fix other people's sites. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27970> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain
lilydjwg added the comment: Please read my code. I've provided the CA certificate; this should work because I've downloaded the certificate manually and feed it to Python. openssl command line tool works. gnutls-cli works too. wget (with openssl) works too. curl (with openssl) fails like Python but I don't understand why. I've successfully done things like this before, but now I encounter a site that Python can't verify with the correct CA certificate (that other tools accept). -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27970> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27970] ssl: can't verify a trusted site with imcomplete certificate chain
New submission from lilydjwg: This fails: Python 3.5.2 (default, Jun 28 2016, 08:46:01) [GCC 6.1.1 20160602] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> import socket >>> s = socket.socket() >>> c = >>> ssl.create_default_context(cafile='COMODORSADomainValidationSecureServerCA.crt') >>> s = c.wrap_socket(s, server_hostname='miaosss.top') >>> s.connect(('miaosss.top', 443)) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/ssl.py", line 1019, in connect self._real_connect(addr, False) File "/usr/lib/python3.5/ssl.py", line 1010, in _real_connect self.do_handshake() File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645) But openssl can succeed: openssl s_client -connect miaosss.top:443 -CAfile COMODORSADomainValidationSecureServerCA.crt -servername miaosss.top endswith "Verify return code: 0 (ok)" Firefox and SSLlabs (https://www.ssllabs.com/ssltest/analyze.html?d=miaosss.top) both show it's trusted. -- messages: 274542 nosy: lilydjwg priority: normal severity: normal status: open title: ssl: can't verify a trusted site with imcomplete certificate chain type: behavior versions: Python 3.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27970> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21047] html.parser.HTMLParser: convert_charrefs should become True by default
lilydjwg added the comment: FYI, this breaks one of my programs. I find it now because it only threw errors in rare cases, and I've never seen the deprecated warning because I don't check the logs unless something goes wrong. -- nosy: +lilydjwg ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21047> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24494] Can't specify encoding with fileinput and inplace=True
New submission from lilydjwg: I want to use fileinput to modify files, but find no way to specify the file encoding. I tried to use hook_encoded, but it says FileInput cannot use an opening hook in inplace mode. -- components: Library (Lib) messages: 245711 nosy: lilydjwg priority: normal severity: normal status: open title: Can't specify encoding with fileinput and inplace=True versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24494 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print or input Unicode
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8106] SSL session management
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8106 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23262] webbrowser module broken with Firefox 36+
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23262 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5907] repr of time.struct_time type does not eval
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5907 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11698] Improve repr for structseq objects to show named, but unindexed fields
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11698 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13936 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without empty line after each message
lilydjwg added the comment: My system has updated to Python 3.3.0 and this bugs me again :-( I don't see the changes in Python 3.3.0. So when will this be merged into 3.3? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without empty line after each message
lilydjwg added the comment: The last patch works fine here, thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without empty line after each message
lilydjwg lilyd...@gmail.com added the comment: Hi, I have figured it out. The 'mbox2' file should be in correct format now. Run './bug.py' once to delete the last mail. 'cat newmail mbox2' to append a new mail to that mbox. Run './bug.py' again. Now, 'mbox2' doesn't have a newline at the end. (And I think a correct mbox should end with a blank line?) -- status: pending - open Added file: http://bugs.python.org/file26254/mbox2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without empty line after each message
Changes by lilydjwg lilyd...@gmail.com: Added file: http://bugs.python.org/file26255/newmail ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without empty line after each message
Changes by lilydjwg lilyd...@gmail.com: Added file: http://bugs.python.org/file26256/bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without end-of-line at the file end.
lilydjwg lilyd...@gmail.com added the comment: I think I got something wrong. It seems that it only happens when the last message is deleted. I've also made up a sample mbox attached. The code to reproduce: from mailbox import mbox mb = mbox('mbox') del mb[len(mb)-1] mb.close() -- status: pending - open Added file: http://bugs.python.org/file26206/mbox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without empty line after each message
lilydjwg lilyd...@gmail.com added the comment: Hi, Petri Lehtinen. That's a bug of mine. That mbox is made up by me for demo, not procmail which has the newline. However, a newline is indeed lost and in some way it does corrupt my real mbox. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9559] mailbox.mbox creates new file when adding message to mbox
Changes by lilydjwg lilyd...@gmail.com: -- nosy: +lilydjwg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15222] mailbox.mbox writes without end-of-line at the file end.
New submission from lilydjwg lilyd...@gmail.com: I find that when mbox writes mails back, it loses the last end-of-line, making appending new mails to the mbox becomes incorrect. I'm using Linux. In _singlefileMailbox.flush(), when writing the mbox, it loses the last byte ('\n') at the end of each message (because the position from '_toc' is inclusive), and mbox._pre_message_hook() adds it back, but only between two messages. So the last message ends without a '\n'. -- components: Library (Lib) messages: 164313 nosy: lilydjwg priority: normal severity: normal status: open title: mailbox.mbox writes without end-of-line at the file end. type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15222 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12275] urllib.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain
New submission from lilydjwg lilyd...@gmail.com: On redirecting to a url like '/login', at around line 556 of request.py it will raise an HTTPError. The sys.verrsion is Python 3.2 (r32:88445, Apr 15 2011, 11:20:08) [GCC 4.5.2 20110127 (prerelease)] on linux2 -- components: Library (Lib) messages: 137791 nosy: lilydjwg priority: normal severity: normal status: open title: urllib.request.HTTPRedirectHandler won't redirect to a URL with only path but not domain versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12275 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com