biopython/biopython — pull request #99 by bow (2012-11-30 02:28:01+00:00)
Title: Patch searchio blast xml encoding

This pull request addresses these recent buildbot failures:

* http://testing.open-bio.org/biopython/builders/Windows%20XP%20-%20Python%203.2/builds/512/steps/shell/logs/stdio

* http://testing.open-bio.org/biopython/builders/Windows%20XP%20-%20Python%203.3/builds/29/steps/shell/logs/stdio

These were caused by the way `xml.etree` determines the encoding it uses to parse the input XML file. Since BLAST XML files do not explicitly specify any encodings, `xml.etree` defaults to ascii. However, some BLAST XML files may contain utf-8 characters, which will break parsing.

The patch forces any BLAST XML files opened using `Bio.SearchIO` to use utf-8 encoding. Additionally, there's a small tweak to `Bio.File.as_handle` so that it can open files using specific encoding, if it is specified.