-
Notifications
You must be signed in to change notification settings - Fork 986
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
fread showing HTTP error when read.csv does not #4659
Comments
It seems that
To not rely on
|
thanks for the investigation... why then does read.csv succeed? does it
have such a redirect/is it doing url encoding?
…On Wed, Aug 5, 2020, 12:45 PM ben-schwen ***@***.***> wrote:
It seems that curl has problems with unencoded urls.
url = "https://github.com/OpportunityInsights/EconomicTracker/raw/main/data/Google Mobility - County - Daily.csv"
# fails
dt = fread(url)
# works
dt = fread(utils::URLencode(url))
df = read.csv(url, nrows = 10)
To not rely on utils, one could use
invalid_chars = "[^][!$&'()*+,;=:/?@#ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._~-]"
valid_url = gsub(invalid_chars, "%20\\1", url)
fread(valid_url)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4659 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2BA5JN2WVKCDGLKGF6YOLR7GED3ANCNFSM4PUGMHTA>
.
|
As far as I understand: Furthermore it is also mentioned in the It seems like this is another follow-up on #1686 Strange enough it appears that |
fread is able to correctly load a csv file that was downloaded to a local folder, but not the same csv file from the web. Function read.csv is able to correctly load the same csv file from the web. The issue was perceived in the following code as seen in the attached PDF, which also contains the session info. Also, I would note that I'm not running this behind any corporate firewall (although I also got the same error when I ran from behind a corporate firewall in another computer.)
fread_bug_report.pdf
The text was updated successfully, but these errors were encountered: