If I pass a file opened in text mode (mode='r' as oppose to mode='rb'), OfxParser.parse fails, in Python 3 (3.5, to be more exact) because it ends up trying to mix bytes and str when reading the headers, here. Even after fixing it, though, it still fails in OfxPreprocessedFile, when it tries to read from self.fh. It happens because self.fh, at that point, is a codecs.StreamReader, which will only work with bytes streams (again, at least on Python 3). This pull request fixes this, at least in Python 3.5 and 2.7.
If I pass a file opened in text mode (mode='r' as oppose to mode='rb'), OfxParser.parse fails, in Python 3 (3.5, to be more exact) because it ends up trying to mix bytes and str when reading the headers, here. Even after fixing it, though, it still fails in OfxPreprocessedFile, when it tries to read from self.fh. It happens because self.fh, at that point, is a codecs.StreamReader, which will only work with bytes streams (again, at least on Python 3). This pull request fixes this, at least in Python 3.5 and 2.7.