fix PYTHONASYNCIODEBUG and AIOHTTP_NO_EXTENSIONS usage#551
fix PYTHONASYNCIODEBUG and AIOHTTP_NO_EXTENSIONS usage#551asvetlov merged 2 commits intoaio-libs:masterfrom
Conversation
PYTHONASYNCIODEBUG environment variable enables asyncio debug mode if it's any **non-empty** string (see <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONASYNCIODEBUG>). In code it's actually implemented in the following way, which corresponds to documented behaviour: self._debug = (not sys.flags.ignore_environment and bool(os.environ.get('PYTHONASYNCIODEBUG'))) Not documented `AIOHTTP_NO_EXTENSIONS` environment variable used in the same way, so it's behaviour is the same.
.travis.yml
Outdated
There was a problem hiding this comment.
I believe one character should be enough
There was a problem hiding this comment.
Actually I prefer to explicitly state meaning of the environment variable to prevent confusions such as fixed in this PR.
Setting PYTHONASYNCIODEBUG to yes, Y, 1, True, T etc, most probably will make reader to think that to negate meaning of the variable he should use no, N, 0, False, F, etc value.
Maybe use shorter value, e.g. set instead of nonemptystring?
There was a problem hiding this comment.
It affects aiohttp contributors only.
Believe me I'll never again forget the rule but I don't want to see nonemptystring every time when I open .travis.yml.
There was a problem hiding this comment.
I don't think this affects only aiohttp contributors. Since this is Open Source project it's common to use any part of it in other projects. For example I used this .travis.yml as reference in aiohttp_cors, and most probably will use again in other asyncio-based project.
What about single character + comment?
1e16a4c to
e28ca41
Compare
fix PYTHONASYNCIODEBUG and AIOHTTP_NO_EXTENSIONS usage
|
Thanks! |
PYTHONASYNCIODEBUGenvironment variable enablesasynciodebug mode if it's any non-empty string (docs).In code it's actually implemented in the following way, which corresponds to the documented behaviour:
Not documented
AIOHTTP_NO_EXTENSIONSenvironment variable used in the same way, so it's behaviour is the same.BTW, maybe
AIOHTTP_NO_EXTENSIONSshould be documented?