Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment: This might be related to below commit :
commit d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e Author: Inada Naoki <songofaca...@gmail.com> Date: Tue Apr 13 13:51:49 2021 +0900 bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353) python -m gzip README.rst (myenv) ➜ cpython git:(main) ✗ git checkout d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e~1 Lib/gzip.py Updated 1 path from 2ea7c00ab4 (myenv) ➜ cpython git:(main) ✗ ./python Python 3.11.0a1+ (heads/main:160c38df7f, Oct 15 2021, 11:25:16) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import gzip >>> len([None for _ in gzip.GzipFile("README.rst.gz")]) 267 >>> (myenv) ➜ cpython git:(main) ✗ git checkout d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e Lib/gzip.py Updated 1 path from 1f9874eec6 (myenv) ➜ cpython git:(main) ✗ ./python Python 3.11.0a1+ (heads/main:160c38df7f, Oct 15 2021, 11:25:16) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import gzip >>> len([None for _ in gzip.GzipFile("README.rst.gz")]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 1, in <listcomp> ValueError: readline of closed file ---------- components: +Library (Lib) keywords: +3.10regression nosy: +methane, xtreak _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45475> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com