homepage

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 vstinner
Recipients doko, pitrou, vstinner
Date 2012年04月05日.11:20:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwbFx9Ncs+0T6_jEGQiGwn=XTYj_bEfzwAYzG5a4icd_3g@mail.gmail.com>
In-reply-to <1333622510.28.0.744366363092.issue14505@psf.upfronthosting.co.za>
Content
> Victor, that sounds like a strange behaviour to me.
We may change PyFile_FromString() to call fclose() when the file is
closed explicitly (call its close() method), but it may break backward
compatibility. I prefer to document the behaviour instead.
> PyFile_FromString is a public API and maybe it shouldn't
> have changed between 2.6 and 2.7.
PyFile_FromString() didn't change in Python 2.7.
I changed PyFile_FromFile() in Python 2.7 to fix the issue #7732.
changeset: 72456:0f5b64630fda
branch: 2.7
parent: 72450:c02e790c4535
user: Victor Stinner <victor.stinner@haypocalc.com>
date: Fri Sep 23 19:37:03 2011 +0200
files: Doc/c-api/file.rst Lib/test/test_import.py Misc/NEWS
Objects/fileobject.c Python/import.c
description:
Issue #7732: Fix a crash on importing a module if a directory has the same name
than a Python module (e.g. "__init__.py"): don't close the file twice.
PyFile_FromFile() does also close the file if PyString_FromString() failed. It
did already close the file on fill_file_fields() error (e.g. if the file is a
directory).
History
Date User Action Args
2012年04月05日 11:20:08vstinnersetrecipients: + vstinner, doko, pitrou
2012年04月05日 11:20:07vstinnerlinkissue14505 messages
2012年04月05日 11:20:07vstinnercreate

AltStyle によって変換されたページ (->オリジナル) /