]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix unicode encoding for non-ASCII characters in title and author names 7696/head
authorAbhishek Varshney <abhishek.varshney@flipkart.com>
Thu, 18 Feb 2016 15:08:57 +0000 (20:38 +0530)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Thu, 18 Feb 2016 15:08:57 +0000 (20:38 +0530)
Signed-off-by: Abhishek Varshney <abhishek.varshney@flipkart.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
src/script/ceph-release-notes

index 925c1d2388f902f56462a7dfec0345b3e9a88287..7f7cd88eab6ddb06fcb3af19cf97f50f6f21d5f0 100755 (executable)
@@ -124,7 +124,7 @@ def make_release_notes(gh, repo, ref, plaintext, verbose, strict):
                 title_re = '^(?:hammer|infernalis|jewel|kraken): (cli|common|mon|osd|fs|librbd|rbd|fs|mds|objecter|rgw|build/ops|tests|tools|cmake|doc|crush|librados)(:.*)'
                 match = re.match(title_re, title)
                 if not match:
-                    print ("ERROR: http://github.com/ceph/ceph/pull/" + str(number) + " title " + title + " does not match " + title_re)
+                    print ("ERROR: http://github.com/ceph/ceph/pull/" + str(number) + " title " + title.encode("utf-8") + " does not match " + title_re)
                 else:
                     title = match.group(1) + match.group(2)
 
@@ -153,9 +153,9 @@ def make_release_notes(gh, repo, ref, plaintext, verbose, strict):
         else:
             issues = ''
         if plaintext:
-            print (u"* {title} ({issues}{author})".format(title=title, issues=issues, author=author))
+            print ("* {title} ({issues}{author})".format(title=title.encode("utf-8"), issues=issues, author=author.encode("utf-8")))
         else:
-            print (u"* {title} ({issues}`pr#{pr} <http://github.com/ceph/ceph/pull/{pr}>`_, {author})".format(title=title, issues=issues, author=author, pr=pr))
+            print ("* {title} ({issues}`pr#{pr} <http://github.com/ceph/ceph/pull/{pr}>`_, {author})".format(title=title.encode("utf-8"), issues=issues, author=author.encode("utf-8"), pr=pr))
         if message:
             print (message)