Results 960 comments of Thomas Grainger

fixed in https://github.com/python-trio/trio/pull/1921 ?

> The threads don't need cleanup Some threads can still acquire resources that need to be waited for on interpreter shutdown re subinterpreters: ``` 10:04:46 vstinner: are daemon threads allowed...

the problem is most sharp with anyio where asyncio users are used to the non-daemonic, cleaned up atexit asyncio.to_thread and trio users expect the opposite

asyncio uses: https://github.com/python/cpython/blob/efe7d08d178a7c09bcca994f2068b019c8633d83/Lib/asyncio/base_events.py#L848-L856 where `None` uses the default executor which defaults to: https://github.com/python/cpython/blob/efe7d08d178a7c09bcca994f2068b019c8633d83/Lib/asyncio/base_events.py#L808-L811 which since https://bugs.python.org/issue39812 does not use daemon threads

Thanks for the redirects here, sometimes I Google something and get to a page that has a "go to latest" the top and it 404s Is there a way to...

@njsmith how about `signal.set_wakeup_fd(-2)`? ```python def is_main_thread(): try: signal.set_wakeup_fd(-2) except OSError: return True except ValueError: return False sys.exit("OH NO WE SET THE WAKEUP FD TO -2") ```

> calls `theStr.encode('charmap')` on the offending string(s) prior to passing them to `hmac.compare_digest`. also worth bearing in mind that `hmac.compare_digest` only supports ascii str ``` >>> 'caf\N{LATIN SMALL LETTER E...

I'd like to see threads be able to run code directly in the nursery that started it, this should fix this issue more robustly. I'll edit this comment to link...