This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e72b82  Handle badly encoded text
4e72b82 is described below

commit 4e72b8234163ac868dd110bd3f6a5230187368c5
Author: Sebb <[email protected]>
AuthorDate: Fri Feb 12 00:32:57 2021 +0000

    Handle badly encoded text
---
 lib/whimsy/asf/nominees.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/nominees.rb b/lib/whimsy/asf/nominees.rb
index 4bfbbe0..a6be45b 100644
--- a/lib/whimsy/asf/nominees.rb
+++ b/lib/whimsy/asf/nominees.rb
@@ -15,7 +15,8 @@ module ASF
       meetings = ASF::SVN['Meetings']
       nominations = Dir[File.join(meetings, '*', 'nominated-members.txt')].max
 
-      nominations = File.read(nominations).split(/^\s*---+--\s*/)
+      # ensure non-UTF-8 chars don't cause a crash
+      nominations = File.read(nominations).encode("utf-8", "utf-8", :invalid 
=> :replace).split(/^\s*---+--\s*/)
       nominations.shift(2)
 
       nominees = {}

Reply via email to