Closed Bug 494512 Opened 15 years ago Closed 15 years ago

[silme] JarClient.get_l10npackage: don't close the jar-file if it was open before

Categories

(Mozilla Localizations :: Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adriank, Assigned: adriank)

References

Details

Attachments

(1 file, 1 obsolete file)

The current behavior, even if we didn't open a jar-file here:
http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme/file/2af263121b1d/lib/silme/io/jar.py#l55
(because cls.zfile existed there already), is, that we close the file here:
http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme/file/2af263121b1d/lib/silme/io/jar.py#l82
anyway.
The more convenient way would be to close it only, if it was opened in line 55.
Blocks: 494517
Depends on: 495051
No longer depends on: 495051
Attached patch patch v1 (obsolete) — Splinter Review
This patch adds a new boolean variable to know if the JAR-file was already open at beginning of the get_l10npackage method. If it wasn't open, the JAR-file will be closed before leaving get_l10npackage, otherwise it will remain open.
Assignee: nobody → akalla
Status: NEW → ASSIGNED
Attachment #379902 - Flags: review?(gandalf)
Comment on attachment 379902 [details] [diff] [review]
patch v1

I'm wondering how we failed to find it earlier especially since I'm pretty sure that _close_jar was tested against it.

Anyway, the patch seems good except that it does not apply against branch nor trunk.

Can you update the patch please?
Attachment #379902 - Flags: review?(gandalf) → review+
taking review from previous patch...
Attachment #379902 - Attachment is obsolete: true
Attachment #380729 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: