This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients docs@python, remi.lapeyre
Date 2020-02-26.11:44:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1582717466.93.0.921378424861.issue39759@roundup.psfhosted.org>
In-reply-to
Content
The documentation states that "*key*, *default* and the result are str." at https://github.com/python/cpython/blame/3.8/Doc/library/os.rst#L224 but either I'm missing something or it's not actually true:

$ python -c 'import os; print(type(os.getenv("FOO")))'           
<class 'NoneType'>
$ python -c 'import os; print(type(os.getenv("FOO", default=1)))'
<class 'int'>

Only *key* needs to be a string as it is used to lookup the value in os.environ.

I think this can be fixed by a new contributor
History
Date User Action Args
2020-02-26 11:44:26remi.lapeyresetrecipients: + remi.lapeyre, docs@python
2020-02-26 11:44:26remi.lapeyresetmessageid: <1582717466.93.0.921378424861.issue39759@roundup.psfhosted.org>
2020-02-26 11:44:26remi.lapeyrelinkissue39759 messages
2020-02-26 11:44:26remi.lapeyrecreate