[New-bugs-announce] [issue33248] Different behavior on macos and linux (docker) with __await__

Jonas Obrist report at bugs.python.org
Mon Apr 9 06:10:20 EDT 2018

New submission from Jonas Obrist <ojiidotch at gmail.com>:

The attached code runs fine on MacOS using 3.6.5 from homebrew. However on Windows (I tested on 3.6.4 with the 32bit installer from the website) and Linux (using the python:3.6.5 docker image) it errors with "TypeError: cannot 'yield from' a coroutine object in a non-coroutine generator".

On MacOS I tried both _UnixSelectorEventLoop with Kqueue and Select selectors, on Linux _UnixSelectorEventLoop with Epoll and Select.

Which behavior is the expected one?

As an aside, what I'm trying to achieve is to have an awaitable object that which if unawaited evaluates to False if used in if statements.

components: asyncio
files: nta.py
messages: 315119
nosy: Jonas Obrist, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Different behavior on macos and linux (docker) with __await__
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47526/nta.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list