]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script: build-integration-branch: avoid Unicode error 21918/head
authorNathan Cutler <ncutler@suse.com>
Thu, 3 May 2018 20:42:04 +0000 (22:42 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 9 May 2018 19:20:34 +0000 (21:20 +0200)
When run on PRs that have non-ASCII characters in their titles, the script
fails like this when run in a non UTF-8 environment:

UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2026' in
position 651: ordinal not in range(256)

Since failing like that is not useful, avoid the error by forcing ASCII
encoding and filtering out any non-ASCII characters.

Fixes: http://tracker.ceph.com/issues/24003
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 6dd31fdbec43e37bece24c0de886d2c4083901c8)

src/script/build-integration-branch

index 263506cb43c5a1c77bd62e54274c2baa5f2c86e5..3189d85d9751e24865faf757aeadc3784d59e469 100755 (executable)
@@ -61,5 +61,5 @@ for pr in prs:
               pr['head']['ref']])
     assert not r
 print('--- done. these PRs were included:')
-print('\n'.join(prtext))
+print('\n'.join(prtext).encode('ascii', errors='ignore').decode())
 print('--- perhaps you want to: make && ctest -j12 && git push ci %s' % branch)