Closed
Bug 1303693
Opened 8 years ago
Closed 8 years ago
OS.File.remove(filename, { ignoreAbsent: true }) throws when the parent directory doesn't exist.
Categories
(Toolkit Graveyard :: OS.File, defect)
Tracking
(firefox51 fixed, firefox52 fixed)
RESOLVED
FIXED
mozilla52
People
(Reporter: markh, Assigned: markh)
References
Details
Attachments
(2 files)
1.17 KB,
patch
|
Details | Diff | Splinter Review | |
58 bytes,
text/x-review-board-request
|
Yoric
:
review+
gchang
:
approval-mozilla-aurora+
|
Details |
OS.File.remove(absent_file_name, {ignoreAbsent: true}) correctly succeeds when absent_file_name doesn't exist but its parent does, but throws when the parent doesn't exist.
Attaching a test, which results in:
> 0:00.58 PROCESS_OUTPUT: Thread-1 (pid:19740) "OS Controller Posting message {"fun":"remove","args":[{"string":"absent_parent\\\\test_osfile_front_absent.tmp"},{"ignoreAbsent":true}],"id":6}"
> 0:00.58 PROCESS_OUTPUT: Thread-1 (pid:19740) "OS Controller Message posted"
> 0:00.58 PROCESS_OUTPUT: Thread-1 (pid:19740) "OS Controller Expecting reply"
> 0:00.58 PROCESS_OUTPUT: Thread-1 (pid:19740) "OS Controller Received message from worker {"fail":{"exn":"OS.File.Error","fileName":"(unknown module)","lineNumber":0,"stack":"","operation":"remove","winLastError":3,"path":"absent_parent\\\\test_osfile_front_absent.tmp"},"id":6}"
> 0:00.58 PROCESS_OUTPUT: Thread-1 (pid:19740) "OS Controller Got error {"data":{"exn":"OS.File.Error","fileName":"(unknown module)","lineNumber":0,"stack":"","operation":"remove","winLastError":3,"path":"absent_parent\\\\test_osfile_front_absent.tmp"}}"
> 0:00.58 TEST_STATUS: Thread-1 test_ignoreAbsent_directory_missing FAIL [test_ignoreAbsent_directory_missing : 55] OS.File.remove should not throw when not requested. - false == true
> ...
(It's possible this is Windows only - ERROR_FILE_NOT_FOUND (2) != ERROR_PATH_NOT_FOUND (3), whereas IIRC, enoent is used for both situations elsewhere? I'll check later)
Yoric, can you please confirm the current behaviour isn't intended?
Flags: needinfo?(dteller)
Good catch, that's not the expected behavior.
Flags: needinfo?(dteller)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → markh
Assignee | ||
Comment 2•8 years ago
|
||
This is a windows only issue. Patch forthcoming.
OS: Unspecified → Windows
Hardware: Unspecified → All
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8792721 [details] Bug 1303693 - OS.File.remove(filename, { ignoreAbsent: true }) throws when the parent directory doesn't exist. https://reviewboard.mozilla.org/r/79634/#review78334 Looks good to me, thanks for the patch.
Attachment #8792721 -
Flags: review?(dteller) → review+
Pushed by mhammond@skippinet.com.au: https://hg.mozilla.org/integration/autoland/rev/0dbdd9bae77e OS.File.remove(filename, { ignoreAbsent: true }) throws when the parent directory doesn't exist. r=Yoric
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0dbdd9bae77e
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Assignee | ||
Comment 7•8 years ago
|
||
Comment on attachment 8792721 [details] Bug 1303693 - OS.File.remove(filename, { ignoreAbsent: true }) throws when the parent directory doesn't exist. Approval Request Comment [Feature/regressing bug #]: N/A [User impact if declined]: Unexpected behaviour in some cases, which results in Sync writing an error logfile when there was no error (bug 1303677) [Describe test coverage new/current, TreeHerder]: new tests [Risks and why]: Low risk this early in the cycle [String/UUID change made/needed]: None
Attachment #8792721 -
Flags: approval-mozilla-aurora?
Updated•8 years ago
|
status-firefox51:
--- → affected
Comment 9•8 years ago
|
||
Comment on attachment 8792721 [details] Bug 1303693 - OS.File.remove(filename, { ignoreAbsent: true }) throws when the parent directory doesn't exist. This patch fixes a test and sync writing an error logfile issue. Take it in 51 aurora.
Attachment #8792721 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 10•8 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/f69efbd61a94
Flags: in-testsuite+
Updated•11 months ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•