def copen ( filepath , flag = 'r' , encoding = None ) : if encoding is None : encoding = locale . getdefaultlocale ( ) [ 1 ] return codecs . open ( filepath , flag , encoding )
python open any file encoding
FIXME : How to test this ?
def copen(filepath, flag='r', encoding=None):

    """
    FIXME: How to test this ?

    >>> c = copen(__file__)
    >>> c is not None
    True
    """
    if encoding is None:
        encoding = locale.getdefaultlocale()[1]

    return codecs.open(filepath, flag, encoding)