From f22b14a8a425650d94fd9fa071f6418ba9ed436d Mon Sep 17 00:00:00 2001
From: Ole Laursen <olau@iola.dk>
Date: Fri, 21 Dec 2012 11:46:42 +0000
Subject: [PATCH 1/2] Fix really weird encoding issue with Python 2.6  -
 Legacy-Id: 5150

---
 ietf/sync/iana.py  | 2 +-
 ietf/sync/tests.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ietf/sync/iana.py b/ietf/sync/iana.py
index f588fb02d..cc72547d5 100644
--- a/ietf/sync/iana.py
+++ b/ietf/sync/iana.py
@@ -201,7 +201,7 @@ def update_history_with_changes(changes, send_email=True):
 
 
 def parse_review_email(text):
-    msg = email.message_from_string(text)
+    msg = email.message_from_string(text.encode("utf-8"))
 
     # doc
     doc_name = ""
diff --git a/ietf/sync/tests.py b/ietf/sync/tests.py
index aed7eb60a..7c85b38dc 100644
--- a/ietf/sync/tests.py
+++ b/ietf/sync/tests.py
@@ -127,6 +127,7 @@ class IANASyncTestCase(django.test.TestCase):
         msg = """From: "%(person)s via RT" <drafts-lastcall@iana.org>
 Date: Thu, 10 May 2012 12:00:00 +0000
 Subject: [IANA #12345] Last Call: <%(draft)s-%(rev)s.txt> (Long text) to Informational RFC
+
 (BEGIN IANA LAST CALL COMMENTS)
 
 IESG:

From 3dccf596b20db6288fc1abc5f9261d14c036fd0f Mon Sep 17 00:00:00 2001
From: Ole Laursen <olau@iola.dk>
Date: Fri, 21 Dec 2012 12:44:55 +0000
Subject: [PATCH 2/2] Fix ordering bug in test code that shows up in MySQL but
 not in SQLite  - Legacy-Id: 5151

---
 ietf/sync/tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ietf/sync/tests.py b/ietf/sync/tests.py
index 7c85b38dc..519c376a2 100644
--- a/ietf/sync/tests.py
+++ b/ietf/sync/tests.py
@@ -441,7 +441,7 @@ class RFCEditorUndoTestCase(django.test.TestCase):
         self.assertEquals(draft.get_state("draft-rfceditor"), None)
 
         # let's just test we can recover
-        e = DeletedEvent.objects.all().order_by("-time")[0]
+        e = DeletedEvent.objects.all().order_by("-time", "-id")[0]
 
         e.content_type.model_class().objects.create(**json.loads(e.json))
         self.assertTrue(StateDocEvent.objects.filter(desc="First", doc=draft))