Python imp 模块,get_magic() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用imp.get_magic()

项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def _write_pyc(state, co, source_stat, pyc):
    # Technically, we don't have to have the same pyc format as
    # (C)Python, since these "pycs" should never be seen by builtin
    # import. However, there's little reason deviate, and I hope
    # sometime to be able to use imp.load_compiled to load them. (See
    # the comment in load_module above.)
    try:
        fp = open(pyc, "wb")
    except IOError:
        err = sys.exc_info()[1].errno
        state.trace("error writing pyc file at %s: errno=%s" %(pyc, err))
        # we ignore any failure to write the cache file
        # there are many reasons, permission-denied, __pycache__ being a
        # file etc.
        return False
    try:
        fp.write(imp.get_magic())
        mtime = int(source_stat.mtime)
        size = source_stat.size & 0xFFFFFFFF
        fp.write(struct.pack("<ll", mtime, size))
        marshal.dump(co, fp)
    finally:
        fp.close()
    return True
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def __init__(self, source, bc={}):
        """Initialize mock.

        'bc' is a dict keyed on a module's name. The value is dict with
        possible keys of 'path', 'mtime', 'magic', and 'bc'. Except for 'path',
        each of those keys control if any part of created bytecode is to
        deviate from default values.

        """
        super().__init__(source)
        self.module_bytecode = {}
        self.path_to_bytecode = {}
        self.bytecode_to_path = {}
        for name, data in bc.items():
            self.path_to_bytecode[data['path']] = name
            self.bytecode_to_path[name] = data['path']
            magic = data.get('magic', imp.get_magic())
            mtime = importlib._w_long(data.get('mtime', self.default_mtime))
            if 'bc' in data:
                bc = data['bc']
            else:
                bc = self.compile_bc(name)
            self.module_bytecode[name] = magic + mtime + bc
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    with open(path, 'rb') as file:
        if file.read(len(magic)) == magic:
            kind = imp.PY_COMPILED
        else:
            kind = imp.PY_SOURCE
        file.seek(0)
        filename = os.path.basename(path)
        name, ext = os.path.splitext(filename)
        try:
            module = imp.load_module(name, file, path, (ext, 'r', kind))
        except:
            raise ErrorDuringImport(path, sys.exc_info())
    return module
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def _write_pyc(state, co, source_stat, pyc):
    # Technically, we don't have to have the same pyc format as
    # (C)Python, since these "pycs" should never be seen by builtin
    # import. However, there's little reason deviate, and I hope
    # sometime to be able to use imp.load_compiled to load them. (See
    # the comment in load_module above.)
    try:
        fp = open(pyc, "wb")
    except IOError:
        err = sys.exc_info()[1].errno
        state.trace("error writing pyc file at %s: errno=%s" %(pyc, err))
        # we ignore any failure to write the cache file
        # there are many reasons, permission-denied, __pycache__ being a
        # file etc.
        return False
    try:
        fp.write(imp.get_magic())
        mtime = int(source_stat.mtime)
        size = source_stat.size & 0xFFFFFFFF
        fp.write(struct.pack("<ll", mtime, size))
        marshal.dump(co, fp)
    finally:
        fp.close()
    return True
项目:web_ctp    作者:molebot    | 项目源码 | 文件源码
def __init__(self, source, bc={}):
        """Initialize mock.

        'bc' is a dict keyed on a module's name. The value is dict with
        possible keys of 'path', 'mtime', 'magic', and 'bc'. Except for 'path',
        each of those keys control if any part of created bytecode is to
        deviate from default values.

        """
        super().__init__(source)
        self.module_bytecode = {}
        self.path_to_bytecode = {}
        self.bytecode_to_path = {}
        for name, data in bc.items():
            self.path_to_bytecode[data['path']] = name
            self.bytecode_to_path[name] = data['path']
            magic = data.get('magic', imp.get_magic())
            mtime = importlib._w_long(data.get('mtime', self.default_mtime))
            source_size = importlib._w_long(len(self.source) & 0xFFFFFFFF)
            if 'bc' in data:
                bc = data['bc']
            else:
                bc = self.compile_bc(name)
            self.module_bytecode[name] = magic + mtime + source_size + bc
项目:web_ctp    作者:molebot    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    with open(path, 'rb') as file:
        if file.read(len(magic)) == magic:
            kind = imp.PY_COMPILED
        else:
            kind = imp.PY_SOURCE
        file.seek(0)
        filename = os.path.basename(path)
        name, ext = os.path.splitext(filename)
        try:
            module = imp.load_module(name, file, path, (ext, 'r', kind))
        except:
            raise ErrorDuringImport(path, sys.exc_info())
    return module
项目:godot-python    作者:touilleMan    | 项目源码 | 文件源码
def _write_pyc(state, co, source_stat, pyc):
    # Technically, we don't have to have the same pyc format as
    # (C)Python, since these "pycs" should never be seen by builtin
    # import. However, there's little reason deviate, and I hope
    # sometime to be able to use imp.load_compiled to load them. (See
    # the comment in load_module above.)
    try:
        fp = open(pyc, "wb")
    except IOError:
        err = sys.exc_info()[1].errno
        state.trace("error writing pyc file at %s: errno=%s" %(pyc, err))
        # we ignore any failure to write the cache file
        # there are many reasons, permission-denied, __pycache__ being a
        # file etc.
        return False
    try:
        fp.write(imp.get_magic())
        mtime = int(source_stat.mtime)
        size = source_stat.size & 0xFFFFFFFF
        fp.write(struct.pack("<ll", mtime, size))
        marshal.dump(co, fp)
    finally:
        fp.close()
    return True
项目:godot-python    作者:touilleMan    | 项目源码 | 文件源码
def _write_pyc(state, co, source_stat, pyc):
    # Technically, we don't have to have the same pyc format as
    # (C)Python, since these "pycs" should never be seen by builtin
    # import. However, there's little reason deviate, and I hope
    # sometime to be able to use imp.load_compiled to load them. (See
    # the comment in load_module above.)
    try:
        fp = open(pyc, "wb")
    except IOError:
        err = sys.exc_info()[1].errno
        state.trace("error writing pyc file at %s: errno=%s" %(pyc, err))
        # we ignore any failure to write the cache file
        # there are many reasons, permission-denied, __pycache__ being a
        # file etc.
        return False
    try:
        fp.write(imp.get_magic())
        mtime = int(source_stat.mtime)
        size = source_stat.size & 0xFFFFFFFF
        fp.write(struct.pack("<ll", mtime, size))
        marshal.dump(co, fp)
    finally:
        fp.close()
    return True
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:PortableApps.com-DevelopmentToolkit    作者:3D1T0R    | 项目源码 | 文件源码
def _make_pyc(code):
    """
    Turn a bytecode object back into an open file representing a '.pyc' file.

    Uses the spec laid out at :

        http://bob.pythonmac.org/archives/2005/03/24/pycs-eggs-and-zipimport/

    It uses the magic number from the ``imp`` module, and four null bytes to
    represent the modification time of the bytecode file.
    """
    n = tempfile.mktemp()
    t = open(n, 'w+b')
    t.write(imp.get_magic() + chr(0) * 4 + marshal.dumps(code))
    t.seek(0)
    _file_array.append((n, t))
    return t
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:empyrion-python-api    作者:huhlig    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:python-xdis    作者:rocky    | 项目源码 | 文件源码
def test_basic(self):
        """Basic test of magic numbers"""
        current = imp.get_magic()
        if hasattr(sys, 'version_info'):
            version = '.'.join([str(v) for v in sys.version_info[0:3]])
            if IS_PYPY:
                version += 'pypy'
            self.assertTrue(version in magics.magics.keys(),
                            "version %s is not in magic.magics.keys: %s" %
                            (version, magics.magics.keys()))

        self.assertEqual(current, magics.int2magic(magics.magic2int(current)))
        lookup = str(PYTHON_VERSION)
        if IS_PYPY:
            lookup += 'pypy'
        self.assertTrue(lookup in magics.magics.keys(),
                        "PYTHON VERSION %s is not in magic.magics.keys: %s" %
                        (lookup, magics.magics.keys()))

        self.assertEqual(magics.sysinfo2magic(), current,
                        "magic from imp.get_magic() should be sysinfo2magic()")
项目:GSM-scanner    作者:yosriayed    | 项目源码 | 文件源码
def _write_pyc(state, co, source_stat, pyc):
    # Technically, we don't have to have the same pyc format as
    # (C)Python, since these "pycs" should never be seen by builtin
    # import. However, there's little reason deviate, and I hope
    # sometime to be able to use imp.load_compiled to load them. (See
    # the comment in load_module above.)
    try:
        fp = open(pyc, "wb")
    except IOError:
        err = sys.exc_info()[1].errno
        state.trace("error writing pyc file at %s: errno=%s" %(pyc, err))
        # we ignore any failure to write the cache file
        # there are many reasons, permission-denied, __pycache__ being a
        # file etc.
        return False
    try:
        fp.write(imp.get_magic())
        mtime = int(source_stat.mtime)
        size = source_stat.size & 0xFFFFFFFF
        fp.write(struct.pack("<ll", mtime, size))
        marshal.dump(co, fp)
    finally:
        fp.close()
    return True
项目:femtocode    作者:diana-hep    | 项目源码 | 文件源码
def extract(binary):
    '''
    Extract a code object from a binary pyc file.

    :param binary: a sequence of bytes from a pyc file.
    '''
    if len(binary) <= 8:
        raise Exception("Binary pyc must be greater than 8 bytes (got %i)" % len(binary))

    magic = binary[:4]
    MAGIC = get_magic()

    if magic != MAGIC:
        raise Exception("Python version mismatch (%r != %r) Is this a pyc file?" % (magic, MAGIC))

    modtime = time.asctime(time.localtime(struct.unpack('i', binary[4:8])[0]))

    code = marshal.loads(binary[8:])

    return modtime, code
项目:kind2anki    作者:prz3m    | 项目源码 | 文件源码
def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = imp.get_magic()
    file = open(path, 'r')
    if file.read(len(magic)) == magic:
        kind = imp.PY_COMPILED
    else:
        kind = imp.PY_SOURCE
    file.close()
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    file = open(path, 'r')
    try:
        module = imp.load_module(name, file, path, (ext, 'r', kind))
    except:
        raise ErrorDuringImport(path, sys.exc_info())
    file.close()
    return module
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def load_module(self, fqname, fp, pathname, file_info):
        suffix, mode, type = file_info
        self.msgin(2, "load_module", fqname, fp and "fp", pathname)
        if type == imp.PKG_DIRECTORY:
            m = self.load_package(fqname, pathname)
            self.msgout(2, "load_module ->", m)
            return m
        if type == imp.PY_SOURCE:
            co = compile(fp.read()+'\n', pathname, 'exec')
        elif type == imp.PY_COMPILED:
            if fp.read(4) != imp.get_magic():
                self.msgout(2, "raise ImportError: Bad magic number", pathname)
                raise ImportError, "Bad magic number in %s" % pathname
            fp.read(4)
            co = marshal.load(fp)
        else:
            co = None
        m = self.add_module(fqname)
        m.__file__ = pathname
        if co:
            if self.replace_paths:
                co = self.replace_paths_in_code(co)
            m.__code__ = co
            self.scan_code(co, m)
        self.msgout(2, "load_module ->", m)
        return m
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def _read_pyc(source, pyc, trace=lambda x: None):
    """Possibly read a pytest pyc containing rewritten code.

    Return rewritten code if successful or None if not.
    """
    try:
        fp = open(pyc, "rb")
    except IOError:
        return None
    with fp:
        try:
            mtime = int(source.mtime())
            size = source.size()
            data = fp.read(12)
        except EnvironmentError as e:
            trace('_read_pyc(%s): EnvironmentError %s' % (source, e))
            return None
        # Check for invalid or out of date pyc file.
        if (len(data) != 12 or data[:4] != imp.get_magic() or
                struct.unpack("<ll", data[4:]) != (mtime, size)):
            trace('_read_pyc(%s): invalid or out of date pyc' % source)
            return None
        try:
            co = marshal.load(fp)
        except Exception as e:
            trace('_read_pyc(%s): marshal.load error %s' % (source, e))
            return None
        if not isinstance(co, types.CodeType):
            trace('_read_pyc(%s): not a code object' % source)
            return None
        return co
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def load_module(self, fqname, fp, pathname, file_info):
        suffix, mode, type = file_info
        self.msgin(2, "load_module", fqname, fp and "fp", pathname)
        if type == imp.PKG_DIRECTORY:
            m = self.load_package(fqname, pathname)
            self.msgout(2, "load_module ->", m)
            return m
        if type == imp.PY_SOURCE:
            co = compile(fp.read()+'\n', pathname, 'exec')
        elif type == imp.PY_COMPILED:
            if fp.read(4) != imp.get_magic():
                self.msgout(2, "raise ImportError: Bad magic number", pathname)
                raise ImportError, "Bad magic number in %s" % pathname
            fp.read(4)
            co = marshal.load(fp)
        else:
            co = None
        m = self.add_module(fqname)
        m.__file__ = pathname
        if co:
            if self.replace_paths:
                co = self.replace_paths_in_code(co)
            m.__code__ = co
            self.scan_code(co, m)
        self.msgout(2, "load_module ->", m)
        return m
项目:touch-pay-client    作者:HackPucBemobi    | 项目源码 | 文件源码
def read_pyc(filename):
    """
    Read the code inside a bytecode compiled file if the MAGIC number is
    compatible

    Returns:
        a code object
    """
    data = read_file(filename, 'rb')
    if not is_gae and data[:4] != imp.get_magic():
        raise SystemError('compiled code is incompatible')
    return marshal.loads(data[marshal_header_size:])
项目:jtc    作者:jwilk-archive    | 项目源码 | 文件源码
def compile_pyc(self, output_file):
        '''[py] Compile the program into a Python bytecode file.'''
        import imp
        import marshal
        output_file.write(imp.get_magic())
        output_file.write('\x00\x00\x00\x00')
        pyc = self.to_pyc()
        pyo = pyc.to_code()
        marshal.dump(pyo, output_file)
项目:mitogen    作者:dw    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def make_code_from_pyc(filename):
    """Get a code object from a .pyc file."""
    try:
        fpyc = open(filename, "rb")
    except IOError:
        raise NoCode("No file to run: %r" % filename)

    try:
        # First four bytes are a version-specific magic number.  It has to
        # match or we won't run the file.
        magic = fpyc.read(4)
        if magic != imp.get_magic():
            raise NoCode("Bad magic number in .pyc file")

        # Skip the junk in the header that we don't need.
        fpyc.read(4)            # Skip the moddate.
        if sys.version_info >= (3, 3):
            # 3.3 added another long to the header (size), skip it.
            fpyc.read(4)

        # The rest of the file is the code object we want.
        code = marshal.load(fpyc)
    finally:
        fpyc.close()

    return code
项目:MKFQ    作者:maojingios    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:true_review_web2py    作者:lucadealfaro    | 项目源码 | 文件源码
def read_pyc(filename):
    """
    Read the code inside a bytecode compiled file if the MAGIC number is
    compatible

    Returns:
        a code object
    """
    data = read_file(filename, 'rb')
    if not is_gae and data[:4] != imp.get_magic():
        raise SystemError('compiled code is incompatible')
    return marshal.loads(data[8:])
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def test_bad_magic(self):
        # When the magic number is different, the bytecode should be
        # regenerated.
        def test(name, mapping, bytecode_path):
            self.import_(mapping[name], name)
            with open(bytecode_path, 'rb') as bytecode_file:
                self.assertEqual(bytecode_file.read(4), imp.get_magic())

        self._test_bad_magic(test)
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def __init__(self, path, magic=imp.get_magic()):
        super().__init__(path)
        self.bytecode_path = imp.cache_from_source(self.path)
        data = bytearray(magic)
        data.extend(marshal._w_long(self.source_mtime))
        code_object = compile(self.source, self.path, 'exec',
                                dont_inherit=True)
        data.extend(marshal.dumps(code_object))
        self.bytecode = bytes(data)
        self.written = {}
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def verify_bytecode(self, mock, name):
        assert name in mock.module_paths
        self.assertIn(name, mock.module_bytecode)
        magic = mock.module_bytecode[name][:4]
        self.assertEqual(magic, imp.get_magic())
        mtime = importlib._r_long(mock.module_bytecode[name][4:8])
        self.assertEqual(mtime, 1)
        bc = mock.module_bytecode[name][8:]
        self.assertEqual(bc, mock.compile_bc(name))
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def test_different_magic(self):
        # A different magic number should lead to new bytecode.
        name = 'mod'
        bad_magic = b'\x00\x00\x00\x00'
        assert bad_magic != imp.get_magic()
        mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')},
                                {name: {'path': os.path.join('path', 'to',
                                                    'mod.bytecode'),
                                        'magic': bad_magic}})
        with util.uncache(name):
            mock.load_module(name)
        self.assertTrue(name in mock.module_bytecode)
        magic = mock.module_bytecode[name][:4]
        self.assertEqual(magic, imp.get_magic())
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def load_module(self, fqname, fp, pathname, file_info):
        suffix, mode, type = file_info
        self.msgin(2, "load_module", fqname, fp and "fp", pathname)
        if type == imp.PKG_DIRECTORY:
            m = self.load_package(fqname, pathname)
            self.msgout(2, "load_module ->", m)
            return m
        if type == imp.PY_SOURCE:
            co = compile(fp.read()+'\n', pathname, 'exec')
        elif type == imp.PY_COMPILED:
            if fp.read(4) != imp.get_magic():
                self.msgout(2, "raise ImportError: Bad magic number", pathname)
                raise ImportError("Bad magic number in %s" % pathname)
            fp.read(4)
            co = marshal.load(fp)
        else:
            co = None
        m = self.add_module(fqname)
        m.__file__ = pathname
        if co:
            if self.replace_paths:
                co = self.replace_paths_in_code(co)
            m.__code__ = co
            self.scan_code(co, m)
        self.msgout(2, "load_module ->", m)
        return m
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def make_pyc(co, mtime):
    data = marshal.dumps(co)
    if type(mtime) is type(0.0):
        # Mac mtimes need a bit of special casing
        if mtime < 0x7fffffff:
            mtime = int(mtime)
        else:
            mtime = int(-0x100000000 + int(mtime))
    pyc = imp.get_magic() + struct.pack("<i", int(mtime)) + data
    return pyc
项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def data(self):
        with open(self.bc_path, 'rb') as file:
            data = file.read(8)
        mtime = int(os.stat(self.source_path).st_mtime)
        compare = struct.pack('<4sl', imp.get_magic(), mtime)
        return data, compare
项目:codingTheMatrix    作者:RestrictedZone    | 项目源码 | 文件源码
def _get_module():
    del globals()['_get_module']
    import imp
    import base64
    import marshal

    magic = imp.get_magic()
    if magic == b'O\x0c\r\n': # Python 3.1
        pycData = b'TwwNChNz/FRjAAAAAAAAAAAAAAAABAAAAEAAAABzdAAAAGQAAGQBAGwAAFoAAEdkAgCEAABkAwCD\nAgBaAQBkBABkBQCEAQBaAgBkBgCEAABaAwBkBwCEAABaBABkCACEAABaBQBkCQCEAABaBgBkAABl\nBQBfBwBkCgBlBQBfCABkAABlBgBfBwBkCgBlBgBfCABkAQBTKAsAAABpAAAAAE5jAQAAAAAAAAAB\nAAAAAwAAAEIAAABzXwAAAHwAAEVlAABaAQBlAgCDAABpAABkAACEAgBaAwBkAQCEAABaBABkAgCE\nAABaBQBkAwCEAABaBgBkBACEAABaBwBkBQCEAABaCABkBgCEAABaCQBkBwCEAABaCgBkCABTKAkA\nAABjAwAAAAAAAAADAAAAAgAAAEMAAABzFgAAAHwBAHwAAF8AAHwCAHwAAF8BAGQAAFMoAQAAAE4o\nAgAAAHUBAAAARHUBAAAAZigDAAAAdQQAAABzZWxmdQYAAABsYWJlbHN1CAAAAGZ1bmN0aW9u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NfaW5kZXBl\nbmRlbnQoW2EwLCBhMSwgYTIsIGEzXSkKICAgIEZhbHNlCiAgICBpAQAAACgIAAAAdQoAAABpc2lu\nc3RhbmNldQQAAABsaXN0dQMAAABzZXR1DgAAAEFzc2VydGlvbkVycm9ydQ4AAABpc19pbmRlcGVu\nZGVudHUJAAAAX19jYWxsc19fdQUAAABfcmFua3UDAAAAbGVuKAEAAAB1AQAAAEwoAAAAACgAAAAA\ndSQAAAAuLi9yZXNvdXJjZXMvcHJpdmF0ZS9pbmRlcGVuZGVuY2UucHl1DgAAAGlzX2luZGVwZW5k\nZW50WQAAAHMGAAAAABwbAQ8BdQwAAABpbnN0cnVtZW50ZWQoCQAAAHUDAAAAR0YydQQAAABfVmVj\ndQcAAABfUl9yYW5rdQkAAABfR0YyX3Jhbmt1BQAAAF9yYW5rdQQAAAByYW5rdQ4AAABpc19pbmRl\ncGVuZGVudHUJAAAAX19jYWxsc19fdQsAAABfX3ZlcnNpb25fXygAAAAAKAAAAAAoAAAAAHUkAAAA\nLi4vcmVzb3VyY2VzL3ByaXZhdGUvaW5kZXBlbmRlbmNlLnB5dQgAAAA8bW9kdWxlPgIAAABzFAAA\nAAwCEBcMCAkNCQoJHwkgCQEJAQkB\n'
        offset = 8
    elif magic == b'l\x0c\r\n': # Python 3.2
        pycData = b'bAwNChNz/FRjAAAAAAAAAAAAAAAAAwAAAEAAAABzdAAAAGQAAGQBAGwAAFoAAEdkAgCEAABkAwCD\nAgBaAQBkBABkBQCEAQBaAgBkBgCEAABaAwBkBwCEAABaBABkCACEAABaBQBkCQCEAABaBgBkAABl\nBQBfBwBkCgBlBQBfCABkAABlBgBfBwBkCgBlBgBfCABkAQBTKAsAAABpAAAAAE5jAQAAAAAAAAAB\nAAAAAwAAAEIAAABzXwAAAHwAAEVlAABaAQBlAgCDAABpAABkAACEAgBaAwBkAQCEAABaBABkAgCE\nAABaBQBkAwCEAABaBgBkBACEAABaBwBkBQCEAABaCABkBgCEAABaCQBkBwCEAABa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BGYWxzZQogICAgPj4+IGlzX2luZGVw\nZW5kZW50KHthMCwgYTEsIGEzfSkKICAgIFRydWUKICAgID4+PiBpc19pbmRlcGVuZGVudChbYTAs\nIGExLCBhMiwgYTNdKQogICAgRmFsc2UKICAgIHIOAAAAKQhyGQAAAHI1AAAAch8AAAByNgAAANoO\naXNfaW5kZXBlbmRlbnRyOAAAAHI0AAAAcikAAAApAXIqAAAAcgYAAAByBgAAAHIHAAAAcjkAAABZ\nAAAAcwYAAAAAHBsBDwFyOQAAAFoMaW5zdHJ1bWVudGVkKQlyMwAAAHICAAAAcisAAAByMQAAAHI0\nAAAAcjcAAAByOQAAAHI4AAAA2gtfX3ZlcnNpb25fX3IGAAAAcgYAAAByBgAAAHIHAAAA2gg8bW9k\ndWxlPgIAAABzFAAAAAwCExcPCAwNDAoMHwwgCQEJAQkB\n'
        offset = 12
    elif magic == b'\xf8\x0c\r\n': # Python 3.5
        pycData = b'+AwNChNz/FTtDQAA4wAAAAAAAAAAAAAAAAMAAABAAAAAc4YAAABkAABkAQBsAABaAABHZAIAZAMA\nhAAAZAMAgwIAWgEAZAQAZAUAZAYAhAEAWgIAZAcAZAgAhAAAWgMAZAkAZAoAhAAAWgQAZAsAZAwA\nhAAAWgUAZA0AZA4AhAAAWgYAZAAAZQUAXwcAZA8AZQUAXwgAZAAAZQYAXwcAZA8AZQYAXwgAZAEA\nUykQ6QAAAABOYwAAAAAAAAAAAAAAAAQAAABAAAAAc3kAAABlAABaAQBkAABaAgBlAwCDAABpAABk\nAQBkAgCEAgBaBABkAwBkBACEAABaBQBkBQBkBgCEAABaBgBkBwBkCACEAABaBwBkCQBkCgCEAABa\nCABkCwBkDACEAABaCQBkDQBkDgCEAABaCgBkDwBkEACEAABaCwBkEQBTKRLaBF9WZWNjAwAAAAAA\nAAADAAAAAgAAAEMAAABzFgAAAHwBAHwAAF8AAHwCAHwAAF8BAGQAAFMpAU4pAtoBRNoBZikD2gRz\nZWxmWgZsYWJlbHNaCGZ1bmN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AAcgYAAAByBgAAAHIHAAAAcjkAAABZAAAAcwYA\nAAAAHBsBDwFyOQAAAFoMaW5zdHJ1bWVudGVkKQlyMwAAAHICAAAAcisAAAByMQAAAHI0AAAAcjcA\nAAByOQAAAHI4AAAA2gtfX3ZlcnNpb25fX3IGAAAAcgYAAAByBgAAAHIHAAAA2gg8bW9kdWxlPgIA\nAABzFAAAAAwCExcPCAwNDAoMHwwgCQEJAQkB\n'
        offset = 12
    else:
        raise ImportError("Unsupported Python version")

    pycData = base64.decodebytes(pycData)

    assert pycData[:4] == magic, "Bad magic number"

    try:
        return marshal.loads(pycData[offset:])
    except ValueError:
        raise ImportError("Could not read .pyc data")
项目:Problematica-public    作者:TechMaz    | 项目源码 | 文件源码
def read_pyc(filename):
    """
    Read the code inside a bytecode compiled file if the MAGIC number is
    compatible

    Returns:
        a code object
    """
    data = read_file(filename, 'rb')
    if not is_gae and data[:4] != imp.get_magic():
        raise SystemError('compiled code is incompatible')
    return marshal.loads(data[8:])
项目:driveboardapp    作者:nortd    | 项目源码 | 文件源码
def __init__(self, path=None, start=0):
        """
        Initialize an Archive. If path is omitted, it will be an empty Archive.
        """
        self.toc = None
        self.path = path
        self.start = start

        # In Python 3 module 'imp' is no longer built-in and we cannot use it.
        # There is for Python 3 another way how to obtain magic value.
        if sys.version_info[0] == 2:
            import imp
            self.pymagic = imp.get_magic()
        else:
            # We cannot use at this bootstrap stage importlib directly
            # but its frozen variant.
            import _frozen_importlib
            if sys.version_info[1] <= 3:
                # Python 3.3
                self.pymagic = _frozen_importlib._MAGIC_BYTES
            elif sys.version_info[1] == 4:
                # Python 3.4
                self.pymagic = _frozen_importlib.MAGIC_NUMBER
            else:
                # Python 3.5+
                self.pymagic = _frozen_importlib._bootstrap_external.MAGIC_NUMBER

        if path is not None:
            self.lib = ArchiveFile(self.path, 'rb')
            with self.lib:
                self.checkmagic()
                self.loadtoc()
项目:driveboardapp    作者:nortd    | 项目源码 | 文件源码
def _code_to_file(co):
    """ Convert code object to a .pyc pseudo-file """
    return BytesIO(
            imp.get_magic() + b'\0\0\0\0' + marshal.dumps(co))
项目:driveboardapp    作者:nortd    | 项目源码 | 文件源码
def imp_walk(name):
    """
    yields namepart, tuple_or_importer for each path item

    raise ImportError if a name can not be found.
    """
    warnings.warn("imp_walk will be removed in a future version", DeprecationWarning)

    if name in sys.builtin_module_names:
        yield name, (None, None, ("", "", imp.C_BUILTIN))
        return
    paths = sys.path
    res = None
    for namepart in name.split('.'):
        for path_item in paths:
            res = _check_importer_for_path(namepart, path_item)
            if hasattr(res, 'load_module'):
                if res.path.endswith('.py') or res.path.endswith('.pyw'):
                    fp = StringIO(res.get_source(namepart))
                    res = (fp, res.path, ('.py', 'rU', imp.PY_SOURCE))
                elif res.path.endswith('.pyc') or res.path.endswith('.pyo'):
                    co  = res.get_code(namepart)
                    fp = BytesIO(imp.get_magic() + b'\0\0\0\0' + marshal.dumps(co))
                    res = (fp, res.path, ('.pyc', 'rb', imp.PY_COMPILED))

                else:
                    res = (None, loader.path, (os.path.splitext(loader.path)[-1], 'rb', imp.C_EXTENSION))

                break
            elif isinstance(res, tuple):
                break
        else:
            break

        yield namepart, res
        paths = [os.path.join(path_item, namepart)]
    else:
        return

    raise ImportError('No module named %s' % (name,))
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def getPycHeader(filename):
  # compile.c uses marshal to write a long directly, with
  # calling the interface that would also generate a 1-byte code
  # to indicate the type of the value.  simplest way to get the
  # same effect is to call marshal and then skip the code.
  #mtime = os.path.getmtime(filename)
  mtime = 0  # to make it deterministic for now
  mtime = struct.pack('<i', int(mtime))
  return imp.get_magic() + mtime
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def load_module(self, fqname, fp, pathname, file_info):
        suffix, mode, type = file_info
        self.msgin(2, "load_module", fqname, fp and "fp", pathname)
        if type == imp.PKG_DIRECTORY:
            m = self.load_package(fqname, pathname)
            self.msgout(2, "load_module ->", m)
            return m
        if type == imp.PY_SOURCE:
            co = compile(fp.read()+'\n', pathname, 'exec')
        elif type == imp.PY_COMPILED:
            if fp.read(4) != imp.get_magic():
                self.msgout(2, "raise ImportError: Bad magic number", pathname)
                raise ImportError, "Bad magic number in %s" % pathname
            fp.read(4)
            co = marshal.load(fp)
        else:
            co = None
        m = self.add_module(fqname)
        m.__file__ = pathname
        if co:
            if self.replace_paths:
                co = self.replace_paths_in_code(co)
            m.__code__ = co
            self.scan_code(co, m)
        self.msgout(2, "load_module ->", m)
        return m
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def make_pyc(co, mtime):
    data = marshal.dumps(co)
    if type(mtime) is type(0.0):
        # Mac mtimes need a bit of special casing
        if mtime < 0x7fffffff:
            mtime = int(mtime)
        else:
            mtime = int(-0x100000000L + long(mtime))
    pyc = imp.get_magic() + struct.pack("<i", int(mtime)) + data
    return pyc
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def test_mtime(self):
        # Test a change in mtime leads to a new .pyc.
        self.recreation_check(struct.pack('<4sl', imp.get_magic(), 1))
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != imp.get_magic():
        return None

    stream.read(4) # Skip timestamp
    return marshal.load(stream)