Esempio n. 1
0
def open_to_unicode(uri):
    """
    Made for py3.
    """
    try:
        with sopen(uri, mode='r') as fp:
            return fp.read()
    except UnicodeDecodeError:
        with sopen(uri, mode='r+b') as fp:
            return sane_unicode(fp.read())
Esempio n. 2
0
 def readtmp(fname):
     with utils.sopen(fname, mode="r") as fp:
         return fp.read()