How to use the delocate.tools.open_rw function in delocate

To help you get started, we’ve selected a few delocate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthew-brett / delocate / delocate / fuse.py View on Github external
def _copyfile(in_fname, out_fname):
    # Copies files without read / write permission
    perms = chmod_perms(in_fname)
    with open_rw(in_fname, 'rb') as fobj:
        contents = fobj.read()
    with open_rw(out_fname, 'wb') as fobj:
        fobj.write(contents)
    os.chmod(out_fname, perms)
github matthew-brett / delocate / delocate / fuse.py View on Github external
def _copyfile(in_fname, out_fname):
    # Copies files without read / write permission
    perms = chmod_perms(in_fname)
    with open_rw(in_fname, 'rb') as fobj:
        contents = fobj.read()
    with open_rw(out_fname, 'wb') as fobj:
        fobj.write(contents)
    os.chmod(out_fname, perms)
github matthew-brett / delocate / delocate / wheeltools.py View on Github external
def _open_for_csv(name, mode):
    """ Deal with Python 2/3 open API differences """
    if sys.version_info[0] < 3:
        return open_rw(name, mode + 'b')
    return open_rw(name, mode, newline='', encoding='utf-8')
github matthew-brett / delocate / delocate / wheeltools.py View on Github external
def _open_for_csv(name, mode):
    """ Deal with Python 2/3 open API differences """
    if sys.version_info[0] < 3:
        return open_rw(name, mode + 'b')
    return open_rw(name, mode, newline='', encoding='utf-8')