peterjc/backports.lzma — pull request #4 by irvingreid (2014-06-10 14:44:08+00:00)
Title: Remove str/bytes type check for filename; let io.open() do the validity checking.

The use case for this is python2 code that takes advantage of python's automatic transcoding of file names from the file system's character set to Unicode; that allows our python code to not care whether there are special characters in file paths or how they are encoded.
This approach reverses the check inside lzma.open() - if the 'filename' parameter supports a 'read' or 'write' function, treat it as an already opened file, otherwise pass the parameter through to io.open() and let that function throw an error if the parameter is the wrong type.