Navigation Menu

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

Fix cache to avoid encoding exception. #8698

Merged
merged 1 commit into from Sep 10, 2020
Merged

Conversation

marcandre
Copy link
Contributor

Not too sure how come the CI sometimes gets an encoding error:

RuboCop::ResultCache#save when the default internal encoding is UTF-8 writes non UTF-8 encodable data to file with no exception
     Failure/Error:
       rubocop_extra_features
         .select { |path| File.file?(path) }
         .sort!
         .each { |path| digest << Zlib.crc32(IO.read(path)).to_s } # mtime not reliable

     Encoding::InvalidByteSequenceError:
       "\xCE" on US-ASCII
     # ./lib/rubocop/result_cache.rb:179:in `read'
     # ./lib/rubocop/result_cache.rb:179:in `block in rubocop_checksum'
     # ./lib/rubocop/result_cache.rb:179:in `each'
     # ./lib/rubocop/result_cache.rb:179:in `rubocop_checksum'
     # ./lib/rubocop/result_cache.rb:94:in `initialize'
     # ./spec/rubocop/result_cache_spec.rb:7:in `new'

@marcandre marcandre self-assigned this Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant