Skip to content
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

Could not decode json error on OSX #1

Closed
dizballanze opened this issue Sep 4, 2016 · 6 comments
Closed

Could not decode json error on OSX #1

dizballanze opened this issue Sep 4, 2016 · 6 comments

Comments

@dizballanze
Copy link

Hi! I receive following error on OSX:

➜  ~ httpstat https://google.com/

Could not decode json: Expecting property name: line 2 column 22 (char 23)
curl result: 0 {
"time_namelookup": 0,068,
"time_connect": 0,113,
"time_appconnect": 0,302,
"time_pretransfer": 0,302,
"time_redirect": 0,000,
"time_starttransfer": 0,370,
"time_total": 0,370,
"speed_download": 594,000,
"speed_upload": 0,000
}

I think, the problem is in number format, it uses a comma instead of dot as a delimiter.

@reorx
Copy link
Owner

reorx commented Sep 5, 2016

That's strange, I've tested under OSX 10.11.6 and CentOS 7.2, they all format numbers in dot style. Could you please paste your detailed system information and your curl --version output please? Plus, if your curl is installed manually or upgraded using other package manager (i.e homebrew), please also explain that.

@reorx
Copy link
Owner

reorx commented Sep 5, 2016

@dizballanze I'm supposing this is a language locale problem, in Russia you guys use , comma as decimal mark, there may be a env variable like LANG and LC_ALL that affects curl's i18n output, I'll force curl using en_US.UTF-8 as the only language, meanwhile, please paste your `echo "$LANG , $LC_ALL" output in terminal here to help me confirm this problem.

@reorx
Copy link
Owner

reorx commented Sep 5, 2016

I have submit a new version 1.1.2 to try fixing this problem, you can pull for the latest version, or pip install -U httpstat to see if it works.

@semanticdreamer
Copy link

@reorx first things first: THX for providing us w/ this useful script! 👍

Same thing/ issue for me... for locale de:

echo "$LANG , $LC_ALL"
de_DE.UTF-8 ,

The new version fixes this! Awesome. THX for quick response and fix.

@reorx
Copy link
Owner

reorx commented Sep 5, 2016

@semanticdreamer I'm glad it helps, thanks for your appreciation :D

@dizballanze
Copy link
Author

It works now, thanks!

amtrivedi91 added a commit to amtrivedi91/httpstat-py that referenced this issue Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants