Document getfp() function.

This commit is contained in:
Bastian Kleineidam 2013-12-08 11:46:26 +01:00
parent 0fb5a3f826
commit df9a381ae4

View file

@ -575,6 +575,7 @@ def writeFile(filename, content, encoding=None):
raise OSError("empty content for file %s" % filename)
def getfp(filename, encoding):
"""Get open file object."""
if encoding:
return codecs.open(filename, 'w', encoding)
return open(filename, 'wb')