Type of <code>data.strip()</code> changes from <code>str</code> to <code>unicode</code>. So both cases should be handled.