reorx / httpstat

curl statistics made simple
MIT License
5.94k stars 384 forks source link

Could not decode json error on OSX #1

Closed dizballanze closed 8 years ago

dizballanze commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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

dizballanze commented 8 years ago

It works now, thanks!