[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2022-04-08 Thread Thomas Grainger
Thomas Grainger added the comment: the problem is multiprocessing/process is calling threading._shutdown which tries to join its own thread, because concurrent.futures.thread._threads_queues contains the main thread in the subprocess File "/home/graingert/miniconda3/envs

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch nosy: +graingert nosy_count: 4.0 -> 5.0 pull_requests: +30134 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/32044 ___ Python tracker <https://bugs.p

[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-21 Thread Thomas Grainger
New submission from Thomas Grainger : the following code prints: import sys import dis import pprint def demo(): for i in range(1): if i >= 0: pass class Tracer: def __init__(self): self.events = [] def trace(self, frame, event,

[issue47025] bytes do not work on sys.path

2022-03-16 Thread Thomas Grainger
Thomas Grainger added the comment: > I'd advocate for not supporting bytes paths and instead updating the > documentation to require strings. I've got PR GH-31934 started to do this -- message_count: 8.0 -> 9.0 pull_requests: +30026 pull_request: https://github.com/pytho

[issue47026] BytesWarning in zipimport paths on sys.path

2022-03-15 Thread Thomas Grainger
New submission from Thomas Grainger : importing from a bytes zipimport path on sys.path results in a BytesWarning: Comparison between bytes and string running the reproducer with `python -b` shows: python -b zipfile_demo.py :1345: BytesWarning: Comparison between bytes and string see also

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: zipimporter.zipimporter handles non-bytes paths here: https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/zipimport.py#L65-L67 I think FileFinder should do the same -- ___ Python

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: interestingly bytes filenames pointing to zip files on sys.path do support bytes (see zipfile_demo.py) -- Added file: https://bugs.python.org/file50679/zipfile_demo.py ___ Python tracker <https://bugs.python.

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: https://docs.python.org/3/reference/import.html#path-entry-finders says "The encoding of bytes entries is determined by the individual path entry finders." see https://github.com/python/cpython/commit/82c1c781c7ee6496bd4c404b7ba972

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Thomas Grainger added the comment: this is a regression from 3.2: ``` Python 3.2.6 (default, Jan 18 2016, 19:21:14) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tempfile >>>

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31897 ___ Python tracker <https://bugs.python.org/issu

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
Change by Thomas Grainger : -- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker <https://bugs.python.org/issue47

[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger
New submission from Thomas Grainger : importing a module with bytes in `sys.path` fails with: File "", line 182, in _path_isabs TypeError: startswith first arg must be bytes or a tuple of bytes, not str (see reproducer in attached demo.py) however `sys.path` is documented as

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Thomas Grainger
Thomas Grainger added the comment: The main advantage for my usecase is support for heterogeneous unpacking On Sat, Mar 5, 2022, 6:04 PM Alex Waygood wrote: > > Alex Waygood added the comment: > > I sense we'll have to agree to disagree on the usefulness of NamedTuples

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Thomas Grainger
Thomas Grainger added the comment: there could be multiple messages here perhaps it could be: ``` finally: # Must reacquire lock even if wait is cancelled cancelled = [] while True: try: await self.acquire

[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29629 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31499 ___ Python tracker <https://bugs.python.org/issu

[issue46827] asyncio SelectorEventLoop.sock_connect fails with a UDP socket

2022-02-22 Thread Thomas Grainger
New submission from Thomas Grainger : the following code: import socket import asyncio async def amain(): with socket.socket(family=socket.AF_INET, proto=socket.IPPROTO_UDP, type=socket.SOCK_DGRAM) as sock: sock.setblocking(False) await asyncio.get_running_loop

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Thomas Grainger
Thomas Grainger added the comment: hello, it's actually a bit of a round about context, but it was brought up on a tornado issue where I was attempting to port the asyncio optimization to tornado: https://github.com/tornadoweb/tornado/issues/3113#issuecomment-1041019287 I think it would

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +29627 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31497 ___ Python tracker <https://bugs.python.org/issu

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-02-22 Thread Thomas Grainger
New submission from Thomas Grainger : now that the getaddrinfo lock has been removed on all platforms the numeric only host resolve in asyncio could be moved back into BaseEventLoop.getaddrinfo -- components: asyncio messages: 413699 nosy: asvetlov, graingert, yselivanov priority

[issue42752] multiprocessing Queue leaks a file descriptor associated with the pipe writer (#33081 still a problem)

2022-02-17 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert, vstinner ___ Python tracker <https://bugs.python.org/issue42752> ___ ___ Python-bugs-list mailing list Unsub

[issue44863] Allow TypedDict to inherit from Generics

2022-02-03 Thread Thomas Grainger
Thomas Grainger added the comment: there's a thread on typing-sig for this now: https://mail.python.org/archives/list/typing-...@python.org/thread/I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ/#I7P3ER2NH7SENVMIXK74U6L4Z5JDLQGZ -- nosy: +graingert ___ Python

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-01-25 Thread Thomas Grainger
Thomas Grainger added the comment: this also applies to io and _pyio -- ___ Python tracker <https://bugs.python.org/issue46522> ___ ___ Python-bugs-list mailin

[issue46522] concurrent.futures.__getattr__ raises the wrong AttributeError message

2022-01-25 Thread Thomas Grainger
New submission from Thomas Grainger : >>> import types >>> types.ModuleType("concurrent.futures").missing_attribute Traceback (most recent call last): File "", line 1, in AttributeError: module 'concurrent.futures' has no attribute 'missing_at

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2021-12-22 Thread Thomas Grainger
Thomas Grainger added the comment: actually it was already done in 13 months! -- ___ Python tracker <https://bugs.python.org/issue38415> ___ ___ Python-bug

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2021-12-22 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert nosy_count: 3.0 -> 4.0 pull_requests: +28454 pull_request: https://github.com/python/cpython/pull/30233 ___ Python tracker <https://bugs.python.org/issu

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-19 Thread Thomas Grainger
Thomas Grainger added the comment: > Actually I don't agree with Thomas's logic... his argument feels like > consistency for its own sake. Do you expect sync and async contextmanagers to act differently? Why would sync contextmanagers raise AttributeError and async contextmanagers

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: you can see the analogous sync contextmanager issue on python3.6 with: ``` import logging from contextlib import contextmanager @contextmanager def foo(): yield def test(): f = foo() f.__enter__() f.__enter__() test() ``` on python3.7

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: I see the change here: https://github.com/python/cpython/commit/1c5c9c89ffc36875afaf4c3cc6a716d4bd089bbf#diff-e00601a380ba6c916ba4333277fe6ea43d2477804002ab1ae64480f80fec8e3aR177-R179 this is intentionally implementing https://bugs.python.org/issue30306

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: ah I can repeat this on python3.8.10 trio but not python3.9.9 trio: ``` import logging import trio from contextlib import asynccontextmanager @asynccontextmanager async def foo(): await trio.sleep(1) yield async def test(): async

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: or consider the trio version: ``` import logging import trio from contextlib import asynccontextmanager @asynccontextmanager async def foo(): await trio.sleep(1) yield async def test(): async with trio.open_nursery() as n: f = foo

[issue45996] Worse error from asynccontextmanager in Python 3.10

2021-12-06 Thread Thomas Grainger
Thomas Grainger added the comment: I think `AttributeError: args` is the desired/expected behaviour consider the sync version: ``` import logging from asyncio import sleep, gather, run from contextlib import asynccontextmanager, contextmanager @contextmanager def foo(): yield def test

[issue25625] "chdir" Contex manager for pathlib

2021-10-20 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert nosy_count: 10.0 -> 11.0 pull_requests: +27360 pull_request: https://github.com/python/cpython/pull/29091 ___ Python tracker <https://bugs.python.org/issu

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Thomas Grainger
Thomas Grainger added the comment: it's as part of this discussion in https://mail.python.org/archives/list/python-...@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/#IAOCDDCJ653NBED3G2J2YBWD7HHPFHT6 and others in #python-dev specifically https://github.com/python/cpython/blob

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +27181 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28886 ___ Python tracker <https://bugs.python.org/issu

[issue45435] delete misleading faq entry about atomic operations

2021-10-11 Thread Thomas Grainger
Change by Thomas Grainger : -- assignee: docs@python components: Documentation nosy: docs@python, graingert priority: normal severity: normal status: open title: delete misleading faq entry about atomic operations ___ Python tracker <ht

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-07 Thread Thomas Grainger
Thomas Grainger added the comment: afaik this is intentional https://bugs.python.org/issue31033 -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue45

[issue45279] avoid redundant _commit_removals pending_removals guard

2021-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +26930 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28546 ___ Python tracker <https://bugs.python.org/issu

[issue45279] avoid redundant _commit_removals pending_removals guard

2021-09-24 Thread Thomas Grainger
New submission from Thomas Grainger : refactor to avoid redundant _commit_removals pending_removals guard -- components: Library (Lib) messages: 402554 nosy: graingert priority: normal severity: normal status: open title: avoid redundant _commit_removals pending_removals guard versions

[issue45278] RuntimeError on race on weakset concurrent iteration

2021-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue45278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45276] avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic

2021-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +26925 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28541 ___ Python tracker <https://bugs.python.org/issu

[issue45276] avoid try 1000 in asyncio all_tasks by making weak collection .copy() atomic

2021-09-24 Thread Thomas Grainger
New submission from Thomas Grainger : the weak collections should have the same threadsafe/thread unsafe guarantees as their strong reference counterparts - eg dict.copy and set.copy are atomic and so the weak versions should be atomic also -- components: Interpreter Core, asyncio

[issue44962] asyncio.create_task weakrefset race condition

2021-08-24 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +pitrou ___ Python tracker <https://bugs.python.org/issue44962> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44962] asyncio.create_task weakrefset race condition

2021-08-23 Thread Thomas Grainger
Thomas Grainger added the comment: > weakref.WeakSet is not thread-safe, which means concurrent create_task's in > different threads (even on separate event loops) is not safe. actually it looks like WeakSet is *supposed* to be thread-safe ``` import patchy patchy

[issue44962] asyncio.create_task weakrefset race condition

2021-08-23 Thread Thomas Grainger
Change by Thomas Grainger : -- pull_requests: +26373 pull_request: https://github.com/python/cpython/pull/27921 ___ Python tracker <https://bugs.python.org/issue44

[issue44962] asyncio.create_task weakrefset race condition

2021-08-23 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +26365 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27909 ___ Python tracker <https://bugs.python.org/issu

[issue44963] anext_awaitable is not a collections.abc.Generator

2021-08-21 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +pablogsal ___ Python tracker <https://bugs.python.org/issue44963> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44963] anext_awaitable is not a collections.abc.Generator

2021-08-20 Thread Thomas Grainger
Thomas Grainger added the comment: it also fails with asyncio.create_task ``` import asyncio async def agen(): yield async def main(): p = agen() await asyncio.create_task(anext(p, 'finished')) asyncio.run(main()) ``` ``` Traceback (most recent call last): File "

[issue44962] asyncio.create_task weakrefset race condition

2021-08-20 Thread Thomas Grainger
Thomas Grainger added the comment: interestingly 3.10 didn't show: sys:1: RuntimeWarning: coroutine 'BaseEventLoop.shutdown_asyncgens' was never awaited -- ___ Python tracker <https://bugs.python.org/issue44

[issue44962] asyncio.create_task weakrefset race condition

2021-08-20 Thread Thomas Grainger
Thomas Grainger added the comment: still happens on 3.10 even though there's an `with _IterationGuard` ``` worked 0 Traceback (most recent call last): File "/home/graingert/projects/asyncio-demo/demo.py", line 36, in sys.exit(main()) File "/home/graingert/projec

[issue44962] asyncio.create_task weakrefset race condition

2021-08-20 Thread Thomas Grainger
Change by Thomas Grainger : -- versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue44962> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44962] asyncio.create_task weakrefset race condition

2021-08-20 Thread Thomas Grainger
Change by Thomas Grainger : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue44962> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44962] asyncio.create_task weakrefset race condition

2021-08-20 Thread Thomas Grainger
New submission from Thomas Grainger : with the following demo script I can get a IndexError: pop from empty list ``` import itertools import asyncio import concurrent.futures import sys import threading threads = 200 def test_all_tasks_threading() -> None: async def foo() ->

[issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section

2021-08-18 Thread Thomas Grainger
Thomas Grainger added the comment: Depends on the redirect type they create. If it's temporary we should keep the same URL, if it's permanent or otherwise has bookmark updating semantics we should update the URL to follow the redirect On Wed, 18 Aug 2021, 21:40 Jack DeVries, wrote: > >

[issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section

2021-08-16 Thread Thomas Grainger
Thomas Grainger added the comment: It looks like it got archived here https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/qa/bug_writing_guidelines/index.html -- nosy: +graingert ___ Python tracker <https://bugs.python.

[issue44928] async generator missing unawaited coroutine warning

2021-08-16 Thread Thomas Grainger
New submission from Thomas Grainger : demo program: ``` def test_async_fn(): async def async_fn(): pass async_fn() def test_async_gen_fn(): async def agen_fn(): yield agen_fn().aclose() agen_fn().asend(None) test_async_fn() test_async_gen_fn

[issue44908] recommend httpx as well as requests in http.client/urllib.request docs

2021-08-13 Thread Thomas Grainger
New submission from Thomas Grainger : HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2. It's also broadly compatible and inspired by the requests API: https://github.com/encode/httpx/blob/master/docs

[issue44070] __file__ is now fully qualified in 3.8 and 3.9

2021-07-28 Thread Thomas Grainger
Thomas Grainger added the comment: Yep that's the fix I went for in the end https://github.com/twisted/twisted/pull/1628/files#diff-8110fe13865c1f305bb999e82cd7514b2e7269f41087bd7ef39c3d6de508R105 -- ___ Python tracker <ht

[issue37715] 2to3 set default encoding

2021-07-27 Thread Thomas Grainger
Thomas Grainger added the comment: lib2to3 is deprecated and is pending removal, so I think this can be closed -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue37

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-07-27 Thread Thomas Grainger
Thomas Grainger added the comment: > using a per-descriptor `WeakKeyDictionary` to map the instance to locks > (which would of course not work - is there any way to map unhashable > instances weakly?) there's an issue for that too: https://bugs.python.org/i

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-07-27 Thread Thomas Grainger
Thomas Grainger added the comment: how about deprecating the functools.cached_property? -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue43

[issue44686] use pkgutil.resolve_name in unittest.mock

2021-07-20 Thread Thomas Grainger
New submission from Thomas Grainger : per https://bugs.python.org/issue12915 pkgutil.resolve_name was added for use in mock and other stdlib modules: > pydoc has locate and resolve, packaging has util.resolve_name, unittest has > something else, etc. -- messages: 39790

[issue44070] __file__ is now fully qualified in 3.8 and 3.9

2021-07-15 Thread Thomas Grainger
Thomas Grainger added the comment: hello, just chiming in to let you know that this broke CI on twisted: https://github.com/twisted/twisted/pull/1628/ (As above for Chalice, I think this didn't actually break the framework itself, just the tests for the framework. ) do you know what

[issue44611] CPython uses deprecated randomness API

2021-07-12 Thread Thomas Grainger
Thomas Grainger added the comment: https://docs.microsoft.com/en-us/windows/win32/seccng/cng-portal ? -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue44

[issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes

2021-07-12 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +lukasz.langa ___ Python tracker <https://bugs.python.org/issue44428> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +25590 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27024 ___ Python tracker <https://bugs.python.org/issu

[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
Thomas Grainger added the comment: This is the output: ``` Traceback (most recent call last): File "/home/graingert/projects/close.py", line 5, in foo yield File "/home/graingert/projects/close.py", line 12, in raise StartIrritation __main__.StartIrritation

[issue1462485] StopIteration raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
Thomas Grainger added the comment: apologies I meant to post this on a new ticket -- ___ Python tracker <https://bugs.python.org/issue1462485> ___ ___ Python-bug

[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
New submission from Thomas Grainger : https://bugs.python.org/issue1462485 import contextlib @contextlib.contextmanager def foo(): yield class StartIrritation(StopIteration): pass with foo(): raise StartIrritation -- messages: 396979 nosy: graingert, ncoghlan

[issue1462485] StopIteration raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
Thomas Grainger added the comment: ``` import contextlib @contextlib.contextmanager def foo(): yield class StartIrritation(StopIteration): pass with foo(): raise StartIrritation ``` -- nosy: +graingert ___ Python tracker <ht

[issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes

2021-06-26 Thread Thomas Grainger
Thomas Grainger added the comment: nosying the author of the selector_events fix -- ___ Python tracker <https://bugs.python.org/issue44428> ___ ___ Python-bug

[issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes

2021-06-26 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue44428> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33408] Enable AF_UNIX support in Windows

2021-06-26 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue33408> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +nedbat ___ Python tracker <https://bugs.python.org/issue6> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +Mark.Shannon -nedbat ___ Python tracker <https://bugs.python.org/issue6> ___ ___ Python-bugs-list mailing list Unsub

[issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension

2021-06-17 Thread Thomas Grainger
New submission from Thomas Grainger : demo: import traceback import io async def foo(): yield 1 traceback.print_stack(file=io.StringIO()) yield 2 async def bar(): return [chunk async for chunk in foo()] next(bar().__await__(), None) print("working!") Trace

[issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes

2021-06-15 Thread Thomas Grainger
New submission from Thomas Grainger : demo program: import asyncio import socket import threading async def amain(): family = socket.AddressFamily.AF_INET sock = socket.socket(family, socket.SOCK_STREAM) sock.settimeout(1) sock.bind(('localhost', 0)) sock.listen() host

[issue44362] improve documentation of SSL deprecations

2021-06-10 Thread Thomas Grainger
Thomas Grainger added the comment: > Would you like me to submit a PR for this simple patch? > > https://github.com/jdevries3133/cpython/commit/42d9bd7f97f03b49d4fc89780616704998492ac1 TLS_PROTOCOL_CLIENT and TLS_PROTOCOL_SERVER are defined in terms of the deprecated TLS_PROTOCO

[issue44354] ssl deprecation warnings erganomics

2021-06-10 Thread Thomas Grainger
Thomas Grainger added the comment: there should still be a deprecation warning so that 3.12 can raise AttributeError -- ___ Python tracker <https://bugs.python.org/issue44

[issue44354] ssl deprecation warnings erganomics

2021-06-10 Thread Thomas Grainger
Thomas Grainger added the comment: it looks like OP_NO_SSLv2 and OP_NO_SSLv3 are not raising a DeprecationWarning ``` python310 -W error Python 3.10.0b2 (default, Jun 2 2021, 00:22:18) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license&qu

[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Thomas Grainger
Thomas Grainger added the comment: It's also confusing that other not deprecated flags are described in terms of this deprecated flag. These will need rewriting when the deprecated flag is removed -- ___ Python tracker <https://bugs.python.

[issue44362] improve documentation of SSL deprecations

2021-06-09 Thread Thomas Grainger
New submission from Thomas Grainger : > I can see in the 3.10 release notes, that ssl.PROTOCOL_TLS becomes > deprecated. Is there any further context explaining why, and what the > preferred usage is instead, so that I (and anyone else) can understand this a > bit more thorou

[issue44354] ssl deprecation warnings erganomics

2021-06-08 Thread Thomas Grainger
Thomas Grainger added the comment: the "ssl module:" part of the warning message, I think, is redundant as it should be defined in the https://docs.python.org/3/library/warnings.html#warnings.warn_explicit module kwarg -- ___ Pyth

[issue44354] ssl deprecation warnings erganomics

2021-06-08 Thread Thomas Grainger
New submission from Thomas Grainger : The ssl module OP_NO_* deprecation warning message is slightly wrong: The error message prints out "is deprecated is deprecated" because of an earlier format template There's a colon in the warning message `ssl module:` and that makes it

[issue44306] asyncio.from_thread

2021-06-03 Thread Thomas Grainger
Thomas Grainger added the comment: """High-level support for working with threads in asyncio""" import functools import contextvars from . import events from . import tasks __all__ = "to_thread", "from_thread" class _Local(threading

[issue44306] asyncio.from_thread

2021-06-03 Thread Thomas Grainger
New submission from Thomas Grainger : create a asyncio.from_thread shortcut to run async functions from a thread started with asyncio.to_thread ``` def from_thread(async_func, /, *args, **kwargs): """Synchronously run function *async_func* in the event loop thread.

[issue40720] accessing mmap of file that is overwritten causes bus error

2021-03-09 Thread Thomas Grainger
Thomas Grainger added the comment: I can confirm this happens on py3.5-3.10 ``` import mmap import pathlib import tempfile def main(): with tempfile.TemporaryDirectory() as tmp: tmp_path = pathlib.Path(tmp) path = tmp_path / "eg" path.write_bytes(b&qu

[issue43216] Removal of @asyncio.coroutine in Python 3.10

2021-03-06 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert ___ Python tracker <https://bugs.python.org/issue43216> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37771] No equivalent of `inspect.getcoroutinestate` for PyAsyncGenASend instances

2021-03-06 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +alex.gronholm, graingert ___ Python tracker <https://bugs.python.org/issue37771> ___ ___ Python-bugs-list mailing list Unsub

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- pull_requests: +21438 pull_request: https://github.com/python/cpython/pull/22398 ___ Python tracker <https://bugs.python.org/issue41

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Thomas Grainger
Thomas Grainger added the comment: nice the tests pass with that fix -- ___ Python tracker <https://bugs.python.org/issue41602> ___ ___ Python-bugs-list mailin

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Thomas Grainger
Thomas Grainger added the comment: I pushed that patch -- versions: -Python 3.10 ___ Python tracker <https://bugs.python.org/issue41602> ___ ___ Python-bug

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Thomas Grainger
Thomas Grainger added the comment: I'm assuming _Py_UnhandledKeyboardInterrupt is getting incorrectly cleared somewhere in here https://github.com/python/cpython/blob/fc23a9483ef0d7c98bea9f82392377d0b6ef7b18/Modules/main.c#L291-L300 Py_DECREF(runpy); Py_DECREF(runmodule

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Thomas Grainger
Thomas Grainger added the comment: > Okay, I got it. Now my next question. What do you mean by "I've eliminated > runpy" and various other remarks along those lines? I can use `runpy._run_module_as_main` from another Python entry, eg -c and get the correct `-2` >>>

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Thomas Grainger
Thomas Grainger added the comment: The return code of python on linux when the program is ended with a KeyboardInterrupt should be -2, this works in most cases - except when called via "python -m" Does this repl help? Python 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-16 Thread Thomas Grainger
Thomas Grainger added the comment: adding `__main__` owners to nosy -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue41602> ___ ___ Pytho

[issue41676] asyncio.Event.wait broken link from asyncio.Event

2020-08-31 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +21129 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22029 ___ Python tracker <https://bugs.python.org/issu

[issue41676] asyncio.Event.wait broken link from asyncio.Event

2020-08-31 Thread Thomas Grainger
New submission from Thomas Grainger : https://docs.python.org/dev/library/asyncio-sync.html#asyncio.Event links to https://docs.python.org/dev/library/asyncio-task.html#asyncio.wait instead of https://docs.python.org/dev/library/asyncio-sync.html#asyncio.Event.wait -- assignee: docs

[issue41643] make shutil.make_archive always accept pathlib objects

2020-08-26 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +21072 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21962 ___ Python tracker <https://bugs.python.org/issu

[issue41643] make shutil.make_archive always accepts pathlib objects

2020-08-26 Thread Thomas Grainger
New submission from Thomas Grainger : >>> shutil.make_archive(pathlib.Path("./foo"), root_dir=pathlib.Path("./foo"), >>> format="zip") '/home/graingert/projects/ham/foo.zip' >>> shutil.make_archive(pathlib.Path("./foo"), roo

[issue41643] make shutil.make_archive always accept pathlib objects

2020-08-26 Thread Thomas Grainger
Change by Thomas Grainger : -- title: make shutil.make_archive always accepts pathlib objects -> make shutil.make_archive always accept pathlib objects ___ Python tracker <https://bugs.python.org/issu

  1   2   >