New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue creating directories in firefox profiles. #69
Conversation
When the firefox profile contained multiple directories, we failed to correctly create the directories in the destination profile folder. This fix assumes that any file with a name ending / in a zip archive is a directory.
if !dir.exists() { | ||
try!(fs::create_dir_all(dir)); | ||
let name = file.name(); | ||
let is_dir = name.ends_with("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what's the advantage of this method compared to Path.is_dir() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the directory doesn't actually exist yet, so Path.is_dir()
will always be false
.
I confirm this patch allows extracting this archive correctly. The profile is then correctly pushed to Firefox. Before the patch, wires just failed with a cryptic error: DEBUG:wires::marionette: Got NewSession command
DEBUG:webdriver::command: Getting firefox_profile from capabilities
DEBUG:wires::marionette: Using custom profile
INFO:mozprofile::profile: Using profile path /tmp/rust_mozprofile.TwbAvDzFI2wb
DEBUG:webdriver::server: Returning status InternalServerError
DEBUG:webdriver::server: Returning body {"error":"unknown error","message":"other os error"}
DEBUG:hyper::server::response: writing head: Http11 InternalServerError
DEBUG:hyper::server::response: headers [
Headers { Date: Fri, 03 Jun 2016 10:04:03 GMT, Content-Length: 52, Content-Type: application/json, Connection: close, }]
DEBUG:hyper::server::response: write 52 bytes
DEBUG:hyper::server: keep_alive = false for 127.0.0.1:60516
DEBUG:hyper::server: keep_alive loop ending for 127.0.0.1:60516
ERROR { [WebDriverError: Unable to parse new session response: {"error":"unknown error","message":"other os error"}] name: 'WebDriverError' } |
r? @andreastt |
@jgraham Are the changes to Cargo.lock here related to the patch? If not, can you apply that in a separate commit? |
Not really related I don't think. I can break this up. |
104ab0c
to
f914ee7
Compare
Reviewed 1 of 2 files at r1. src/marionette.rs, line 384 [r1] (raw file):
I’m a bit surprised that Comments from Reviewable |
|
This change is