Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
force filename strings to unicode so python can handle encoding stuff

        def makeFileName(s):
    '''force filename strings to unicode so python can handle encoding stuff'''
    if not isUnicode(s):
        s = s.decode('utf8')
    return s
        


src/r/e/reportlab-3.1.8/src/reportlab/pdfbase/pdfdoc.py   reportlab(Download)
from reportlab.pdfbase import pdfutils
from reportlab import rl_config
from reportlab.lib.utils import import_zlib, open_for_read, makeFileName, isSeq, isBytes, isUnicode, _digester, isStr, bytestr, isPy3
from reportlab.lib.rl_accel import escapePDF, fp_str, asciiBase85Encode, asciiBase85Decode
from reportlab.pdfbase import pdfmetrics
    def SaveToFile(self, filename, canvas):
        if hasattr(getattr(filename, "write",None),'__call__'):
            myfile = 0
            f = filename
            filename = makeFileName(getattr(filename,'name',''))
        else :
            myfile = 1
            filename = makeFileName(filename)