diff --git a/openid/oidutil.py b/openid/oidutil.py
index <HASH>..<HASH> 100644
--- a/openid/oidutil.py
+++ b/openid/oidutil.py
@@ -11,6 +11,10 @@ def log(message, unused_level=0):
     sys.stderr.write('\n')
 
 def appendArgs(url, args):
+    if hasattr(args, 'items'):
+        args = args.items()
+        args.sort()
+
     if len(args) == 0:
         return url
[project @ Change behavior of appendArgs to sort dicts before using]