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: gzip.GzipFile has no name attribute
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: lars.gustaebel, loewis
Priority: normal Keywords: patch

Created on 2007-01-29 22:25 by lars.gustaebel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gzip-name-attr.diff lars.gustaebel, 2007-01-29 22:25 patch to Lib/gzip.py
Messages (4)
msg51811 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-01-29 22:25
The gzip.GzipFile object uses a filename instead of a name attribute. This deviates from the standard practice and the interface described in "3.9 File Objects" and seems unnecessary.
Attached patch changes this but still leaves the filename attribute as a property that emits a DeprecationWarning.
msg51812 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-02-12 09:45
Seems that nobody is interested. I will check this in in a few days if nobody objects.
msg51813 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-02-13 12:21
I think the patch is fine. It is debatable whether this should be backported to 2.5; I think it is better to not backport it.

Please also add a test case testing for the presence of the name attribute (feel free to name it test_1647484)
msg51814 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-02-13 16:36
When I wrote the test I saw that in write mode a '.gz' extension is automatically added to the filename if it has none. However this is stripped again when the name is written to the gzip header. I removed this so that the name attribute always reflects the real filesystem name. The filename property imitates the old behaviour.

I don't think that this should necessarily be backported, at least I don't need it ;-)

Applied in rev. 53772.
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44518
2007-01-29 22:25:21lars.gustaebelcreate