Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 287439
Collapse All | Expand All

(-)file_not_specified_in_diff (-2 / +7 lines)
Line  Link Here
0
-- setuptools/command/easy_install.py
0
++ setuptools/command/easy_install.py
Lines 1498-1505 Link Here
1498
def is_sh(executable):
1498
def is_sh(executable):
1499
    """Determine if the specified executable is a .sh (contains a #! line)"""
1499
    """Determine if the specified executable is a .sh (contains a #! line)"""
1500
    try:
1500
    try:
1501
        fp = open(executable)
1501
        fp = open(executable, "rb")
1502
        magic = fp.read(2)
1502
        magic = fp.read(2)
1503
        if sys.hexversion >= 0x3000000:
1504
            try:
1505
                magic = magic.decode()
1506
            except UnicodeDecodeError:
1507
                magic = magic.decode("utf_8", "replace")
1503
        fp.close()
1508
        fp.close()
1504
    except (OSError,IOError): return executable
1509
    except (OSError,IOError): return executable
1505
    return magic == '#!'
1510
    return magic == '#!'

Return to bug 287439