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 serhiy.storchaka
Recipients Mo Ali, serhiy.storchaka
Date 2017-01-17.15:20:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484666415.53.0.758229659838.issue29297@psf.upfronthosting.co.za>
In-reply-to
Content
Builtin open() in Python 3 (and io.open() in Python 2.7) accept unicode strings, byte strings and integers as the first arguments (general path-like objects also are supported in Python 3.6, but it doesn't matter). bool is a subtype of int, and False is equal to integer 0. 0 is a file descriptor of sys.stdin.

>>> import sys
>>> sys.stdin.fileno()
0

Thus open(False) is equivalent to open(sys.stdin.fileno()). It creates a file object that wraps the file descriptor 0. This is legitimate operation.
History
Date User Action Args
2017-01-17 15:20:15serhiy.storchakasetrecipients: + serhiy.storchaka, Mo Ali
2017-01-17 15:20:15serhiy.storchakasetmessageid: <1484666415.53.0.758229659838.issue29297@psf.upfronthosting.co.za>
2017-01-17 15:20:15serhiy.storchakalinkissue29297 messages
2017-01-17 15:20:15serhiy.storchakacreate