[Patches] [ python-Patches-1647484 ] gzip.GzipFile has no name attribute

SourceForge.net noreply at sourceforge.net
Tue Feb 13 17:36:56 CET 2007


Patches item #1647484, was opened at 2007-01-29 23:25
Message generated for change (Comment added) made by gustaebel
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1647484&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.6
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Lars Gustäbel (gustaebel)
Assigned to: Nobody/Anonymous (nobody)
Summary: gzip.GzipFile has no name attribute

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Lars Gustäbel (gustaebel)
Date: 2007-02-13 17:36

Message:
Logged In: YES 
user_id=642936
Originator: YES

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.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2007-02-13 13:21

Message:
Logged In: YES 
user_id=21627
Originator: NO

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)

----------------------------------------------------------------------

Comment By: Lars Gustäbel (gustaebel)
Date: 2007-02-12 10:45

Message:
Logged In: YES 
user_id=642936
Originator: YES

Seems that nobody is interested. I will check this in in a few days if
nobody objects.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1647484&group_id=5470


More information about the Patches mailing list