SilentGhost added the comment:

As explained in the docs[1] integer is a valid argument for the open function 
in the python3. It is also noted that the file descriptor is going to be 
closed, unless closefd argument to the open function was False, when f.close() 
is called. This is the behaviour you're seeing. Zero or other small integers 
tend to point to vital files opened by interpreter or the interpreter itself, 
so closing them shuts the interpreter down. This is a layman explanation, so 
someone should be able to provide a more technical description.

In either case this is not a bug and passing random arguments to the open 
function is probably not what should be done in any production code. I'm 
closing this issue.

[1] https://docs.python.org/3/library/functions.html#open

----------
components: +Interpreter Core -IO
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to