I'm working on an application that needs to scan files from 3rd parties  and process them. Sometimes these are compressed, so I've created a function that checks the file extension (tar.gz, gz, zip) and uncompresses accordingly. Some of the .zip files return this error: NotImplementedError: compression type 12 (bzip2). 
Is there a better way for me to identify the the compression type other than the file extension?
Turns out the zipfile module in Python 2.7 doesn't support a later version of PKZIP that has bzip2 support. Switching to Python 3.3 and using zipfile module works fine.
Python Bzip2 File Hiding as a Zip file