Permalink
Browse files

Remove unnecessary escaping of percent signs.

It turns out that the errors when submitting strings containing percent
signs are due to a limitation in Github's API that PyGithub isn't
properly working around.

Since the escaping makes it more difficult to identify issues and
comments that have already been migrated (due to the need to re-apply
the escaping) we'll just assume a patched version of PyGithub and remove
the escaping altogether.
  • Loading branch information...
1 parent 50fea56 commit e1263478c36a805a5311f06457b80f9879117da0 @dnschnur dnschnur committed Sep 27, 2012
Showing with 3 additions and 10 deletions.
  1. +3 −10 migrateissues.py
View
@@ -49,13 +49,6 @@ def output(string):
sys.stdout.flush()
-def github_escape(string):
-
- """ Returns a copy of the string sanitized for use in Github. """
-
- return string.replace("%", "%")
-
-
def github_label(name, color = "FFFFFF"):
""" Returns the Github label with the given name, creating it if necessary. """
@@ -88,7 +81,7 @@ def add_issue_to_github(issue):
gid = parse_gcode_id(issue.id.text)
status = issue.status.text.lower()
- title = github_escape(issue.title.text)
+ title = issue.title.text
link = issue.link[1].href
author = issue.author[0].name.text
content = issue.content.text
@@ -124,7 +117,7 @@ def add_issue_to_github(issue):
github_issue = None
header = "_Original author: %s (%s)_" % (author, date)
- body = github_escape("%s\n\n%s\n\n\n_Original issue: %s_" % (header, content, link))
+ body = "%s\n\n%s\n\n\n_Original issue: %s_" % (header, content, link)
output("Adding issue %s" % gid)
@@ -190,7 +183,7 @@ def add_comment_to_github(comment, github_issue):
date = parse_gcode_date(comment.published.text)
content = comment.content.text
- body = github_escape("_From %s on %s_\n%s" % (author, date, content))
+ body = "_From %s on %s_\n%s" % (author, date, content)
logging.info("Adding comment %s", gid)

0 comments on commit e126347

Please sign in to comment.