[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
Roundup Robot added the comment: New changeset a98fd4eeed40 by Serhiy Storchaka in branch '3.4': PyErr_NormalizeException doesn't like being called with an exception set http://hg.python.org/cpython/rev/a98fd4eeed40 New changeset 55c50c570098 by Serhiy Storchaka in branch 'default': PyErr_NormalizeException doesn't like being called with an exception set http://hg.python.org/cpython/rev/55c50c570098 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
Roundup Robot added the comment: New changeset 1e30ecbfe181 by Serhiy Storchaka in branch '2.7': Issue #21310: Fixed possible resource leak in failed open(). http://hg.python.org/cpython/rev/1e30ecbfe181 New changeset 17e7934905ab by Serhiy Storchaka in branch '3.4': Issue #21310: Fixed possible resource leak in failed open(). http://hg.python.org/cpython/rev/17e7934905ab New changeset 9c724c428e1f by Serhiy Storchaka in branch 'default': Issue #21310: Fixed possible resource leak in failed open(). http://hg.python.org/cpython/rev/9c724c428e1f -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
Serhiy Storchaka added the comment: Thanks Victor for the review. Thanks Martin for the report. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
Serhiy Storchaka added the comment: Here is a patch which fixes warnings. -- assignee: - serhiy.storchaka keywords: +patch stage: - patch review versions: +Python 2.7, Python 3.5 Added file: http://bugs.python.org/file35403/io_open_resource_warning.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +haypo, pitrou, serhiy.storchaka type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
Serhiy Storchaka added the comment: See also issue20074. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21310] ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable
New submission from Martin Panter: f = open(/dev/stdout, w+b) # Or any non-seekable file, pipe, etc __main__:1: ResourceWarning: unclosed file _io.FileIO name='/dev/stdout' mode='rb+' Traceback (most recent call last): File stdin, line 1, in module io.UnsupportedOperation: File or stream is not seekable. It is mainly just the annoyance of the ResourceWarning, so nothing major. I think this was previously identified in Issue 18116, but it looks like that bug was side-stepped by removing an equivalent fdopen() call. No ResourceWarning happens with an unbuffered file. I haven’t looked at the code but I guess the UnsupportedOperation might only be raised after trying to wrap the open FileIO object in a BufferedWriter object. -- components: IO messages: 216838 nosy: vadmium priority: normal severity: normal status: open title: ResourceWarning when open() fails with io.UnsupportedOperation: File or stream is not seekable versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21310 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com