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

Harden stats script against potential issues #207

Open
stefandesu opened this issue Feb 13, 2024 · 0 comments
Open

Harden stats script against potential issues #207

stefandesu opened this issue Feb 13, 2024 · 0 comments

Comments

@stefandesu
Copy link
Member

The following part of the stats script can cause issues for certain edge cases in the data:

perl -nE 'say "{\"$2\": $1}" if $_ =~ /(\d+)\s+(.+)/' | jq . | jq -s add

For example, I noticed that some addresses contained a tab character (\t) which caused jq to throw an error here: "jq: parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 48, column 21" I think in this particular case, the error is happening because those control characters (like \t, \n, etc.) are interpreted by Perl before being piped into jq. See also: jqlang/jq#1049 (comment)

I fixed the data at https://bartoc.org, so the script runs fine at the moment, but we should fix this at some point.

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

1 participant