Skip to content
This repository has been archived by the owner on Oct 4, 2018. It is now read-only.

UTF-8-encode input from log files in stats reporting #33

Closed
wants to merge 1 commit into from

Conversation

AudreyAltman
Copy link
Contributor

This fixes issue #7763

get-api-stats.rb was throwing an ArgumentError at line 80 if the line being read in from the log file had a non-UTF-8 character. This change encodes each log file line as UTF-8 before the regex evaluation. It also ensures that the regex will use UTF-8 (line 67).

@no-reply
Copy link
Contributor

no-reply commented Dec 4, 2014

Is it feasible to add a test?

@AudreyAltman
Copy link
Contributor Author

I don't believe that there are currently any tests for this file. So yes I could add a test, but I'm not sure if it would be valuable without writing more comprehensive tests for this file.

@no-reply
Copy link
Contributor

no-reply commented Dec 4, 2014

I think a regression test for this particular fix would be useful.

@markbreedlove
Copy link
Contributor

This change looks good to me, though I haven't considered the testing particulars.

@AudreyAltman
Copy link
Contributor Author

After further inspection, I realize that the only logfile that required this fix was actually not a logfile at all. Rather, it was a special record that markbreedlove made to account for the rs to aws changeover. Since we are not likely to ever again encounter a file such as this, and by extension an error such as this, I wonder if it is worth changing the codebase at all.

@anarchivist anarchivist closed this Dec 5, 2014
@anarchivist
Copy link
Contributor

I'll close the PR and add your comment to the ticket.

@AudreyAltman AudreyAltman deleted the 7763-stats-report branch October 21, 2015 14:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants