waylan/Python-Markdown — pull request #226 by Syntho (2013-06-28 12:20:42+00:00)
Title: Fix issue when second value of captured group is None

It is possible to create a regexp with named groups which evaluates some groups values to `None` like in following example:

import re

rx_pattern = r'([^(]|^)(http|https)://(?:www.|)vimeo\.com/(?P\d+)(?:\[(?P\d+|),\s*,\s*(?P\d+|)\]|)\S*'
test_str = "http://vimeo.com/45678967234"

rx = re.compile(rx_pattern)
matches = rx.search(test_str)
print matches.groups() # >>> ('', 'http', '45678967234', None, None)

In this case serializator failed when trying to find something inside string which is `None`