Closed
Bug 1135255
Opened 10 years ago
Closed 10 years ago
devicemanagerADB doesn't close mkstemp() file handles
Categories
(Testing :: Mozbase, defect)
Tracking
(firefox39 fixed)
RESOLVED
FIXED
mozilla39
| Tracking | Status | |
|---|---|---|
| firefox39 | --- | fixed |
People
(Reporter: m1, Assigned: wlach)
References
Details
Attachments
(1 file, 1 obsolete file)
|
2.62 KB,
patch
|
gbrown
:
review+
|
Details | Diff | Splinter Review |
tempfile.mkstemp() returns a file descriptor that the caller is expected to close. Not doing this can cause trouble on platforms such as Windows where it's not permitted to delete an open file
| Reporter | ||
Comment 1•10 years ago
|
||
| Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8567329 [details] [diff] [review]
0001-Bug-1135255-Close-the-fd-that-mkstemp-returns.patch
Review of attachment 8567329 [details] [diff] [review]:
-----------------------------------------------------------------
This is reasonable but I think I'd prefer to use "with". i.e.
with tempfile.NamedTemporarilyFile() as f:
do stuff with f.name
...
This should auto-close the file and be a lot cleaner than what we have right now to boot.
Attachment #8567329 -
Flags: review?(wlachance) → review-
| Reporter | ||
Comment 3•10 years ago
|
||
Ah, yep that would be better. Thanks for the quick feedback. Turns out it's easier for us to maintain this as a local patch ATM than upstream so unassigning myself.
Assignee: mvines → nobody
No longer blocks: CAF-v2.2-metabug
| Assignee | ||
Comment 4•10 years ago
|
||
I figured we may as well fix this properly for next time, while it's fresh in our minds. This uses mozfile's NamedTemporaryFile that should give us the behaviour we want on Windows.
Assignee: nobody → wlachance
Attachment #8567329 -
Attachment is obsolete: true
Attachment #8567954 -
Flags: review?(gbrown)
| Assignee | ||
Comment 5•10 years ago
|
||
try run for b2g to make sure stuff still works: https://treeherder.mozilla.org/#/jobs?repo=try&revision=abc1d2286d56
Updated•10 years ago
|
Attachment #8567954 -
Flags: review?(gbrown) → review+
Comment 7•10 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
| Reporter | ||
Comment 9•10 years ago
|
||
Thanks guys
You need to log in
before you can comment on or make changes to this bug.
Description
•