(filename)
Open a file in read only mode using the encoding detected by
    detect_encoding().
Open a file in read only mode using the encoding detected by
    detect_encoding().
Open a file in read only mode using the encoding detected by detect_encoding () .
def open(filename):
    """Open a file in read only mode using the encoding detected by
    detect_encoding().
    """
    buffer = _builtin_open(filename, 'rb')
    try:
        encoding, lines = detect_encoding(buffer.readline)
        buffer.seek(0)
        text = TextIOWrapper(buffer, encoding, line_buffering=True)
        text.mode = 'r'
        return text
    except:
        buffer.close()
        raise
def open ( filename ) : buffer = _builtin_open ( filename , 'rb' ) try : encoding , lines = detect_encoding ( buffer . readline ) buffer . seek ( 0 ) text = TextIOWrapper ( buffer , encoding , line_buffering = True ) text . mode = 'r' return text except : buffer . close ( ) raise