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.

classification
Title: Closing of sys.std* files in gzip test.
Type: resource usage Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jcea, pitrou, python-dev, serhiy.storchaka
Priority: low Keywords: patch

Created on 2012-08-28 20:52 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gzip_main_close.patch serhiy.storchaka, 2012-08-28 20:52 review
Messages (5)
msg169296 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-08-28 20:52
When porting gzip module from Python 2 to Python 3, binary files sys.std(in|out) was replaced by sys.std(in|out).buffer in gzip module internal testing code (when gzip used as executable). But in one place the replacement was skipped. As the result the condition now always true and standard files are closed after use.

Here is a patch that fixes this error.
msg169367 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2012-08-29 11:31
Test?
msg169407 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-08-29 18:41
I can not imagine how it can be tested. Correction does not affect the current behavior.
msg169421 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-08-29 22:33
New changeset 0b5ba5f610a9 by Antoine Pitrou in branch '3.2':
Issue #15800: fix the closing of input / output files when gzip is used as a script.
http://hg.python.org/cpython/rev/0b5ba5f610a9

New changeset be505d22dde8 by Antoine Pitrou in branch 'default':
Issue #15800: fix the closing of input / output files when gzip is used as a script.
http://hg.python.org/cpython/rev/be505d22dde8
msg169422 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-08-29 22:34
A simple fix indeed, thank you.
History
Date User Action Args
2022-04-11 14:57:35adminsetgithub: 60004
2012-08-29 22:34:22pitrousetstatus: open -> closed
resolution: fixed
messages: + msg169422

stage: resolved
2012-08-29 22:33:56python-devsetnosy: + python-dev
messages: + msg169421
2012-08-29 18:41:27serhiy.storchakasetmessages: + msg169407
2012-08-29 11:31:56jceasetmessages: + msg169367
2012-08-29 00:45:58jceasetnosy: + jcea
2012-08-28 20:52:05serhiy.storchakacreate