def __open_db(self):
        """Opens a DB and return the associated object."""
        pth = os.path.join(self.path, 'db').encode(sys.getfilesystemencoding())
        compressors = self.compressors
        if not compressors:
            compressors = (2,)
            if ord(self.dat_world_version) >= 6:
                compressors = (4, 2)
        if DEBUG_PE:
            write_dump("Binary world version: %s; compressor: %s\n" % (repr(self.dat_world_version), compressors))
        return self.ldb.DB(self.options, pth, compressors=compressors)
Opens a DB and return the associated object.
pymclevel/leveldbpocket.py