-
Notifications
You must be signed in to change notification settings - Fork 71
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
Make sure path has native encoding #183
Conversation
Codecov Report
@@ Coverage Diff @@
## master #183 +/- ##
==========================================
+ Coverage 78.81% 80.56% +1.75%
==========================================
Files 35 35
Lines 1369 1369
==========================================
+ Hits 1079 1103 +24
+ Misses 290 266 -24
Continue to review full report at Codecov.
|
Thanks! Looks good to me. |
I will add a test then (actually, adapt one I added to readxl). |
Fixes #182 Ensure native encoding for this path too
I decided it was pretty clear those other two loci also needed the same and empirically checked this by modifying a test that uses |
Thanks looks good. I don't think we need extra tests. Did you empirically check this on Windows? |
Yes. I did all of this over in Windows. For > tricky_filename <- "\u00C0\u00CB\u00D0"
> file.copy(system.file("DESCRIPTION"), tricky_filename)
[1] TRUE
> hx <- handle_setform(new_handle(),
+ foo = "blabla",
+ bar = charToRaw("boeboe"),
+ iris = form_data(serialize(iris, NULL), "data/rda"),
+ description = form_file("ÀËÐ"),
+ logo = form_file(file.path(Sys.getenv("R_DOC_DIR"), "html/logo.jpg"), "image/jpeg")
+ )
> req <- curl_fetch_memory(httpbin("post"), handle = hx)
> expect_equal(req$status_code, 200)
> devtools::load_all(".")
Loading curl
This is libcurl version 7.64.1 with (OpenSSL/1.1.1a) Schannel
Using test server: http://hb.opencpu.org
> hx <- handle_setform(new_handle(),
+ foo = "blabla",
+ bar = charToRaw("boeboe"),
+ iris = form_data(serialize(iris, NULL), "data/rda"),
+ description = form_file("ÀËÐ"),
+ logo = form_file(file.path(Sys.getenv("R_DOC_DIR"), "html/logo.jpg"), "image/jpeg")
+ )
> req <- curl_fetch_memory(httpbin("post"), handle = hx)
Error in curl_fetch_memory(httpbin("post"), handle = hx) :
Failed to open/read local data from file/application |
Also AppVeyor seems happy. The travis failures do not seem to be related to anything I'm doing 🤷♀️ |
Thanks Jenny! Awesome the detective work 🕵 |
Fixes #182
If you are on board, I can add a test and apply the same
enc2native()
fix to other locations where it's needed.This fixes the reprex I posted in #182 and, when curl is installed from this PR, fixes tidyverse/googledrive#229.
Created on 2019-04-27 by the reprex package (v0.2.1)