Commits

Kirill Simonov committed d7c4cf0

Merged some bug fixes from lib to lib3.

Comments (0)

Files changed (1)

lib3/yaml/emitter.py

             return tag
         handle = None
         suffix = tag
-        for prefix in self.tag_prefixes:
+        prefixes = self.tag_prefixes.keys()
+        prefixes.sort()
+        for prefix in prefixes:
             if tag.startswith(prefix)   \
                     and (prefix == '!' or len(prefix) < len(tag)):
                 handle = self.tag_prefixes[prefix]
             else:
                 if ch is None or ch in ' \n\x85\u2028\u2029':
                     data = text[start:end]
+                    self.column += len(data)
                     if self.encoding:
                         data = data.encode(self.encoding)
                     self.stream.write(data)