Author cjwelborn
Recipients cjwelborn, cool-RR, pitrou, serhiy.storchaka
Date 2014-01-23.20:37:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390509444.93.0.679704875938.issue20218@psf.upfronthosting.co.za>
In-reply-to
Content
Django: https://docs.djangoproject.com/en/dev/ref/files/file/#django.core.files.File

It looks like Django has a File object that wraps around Python's built-in file object. It offers a 'mode' attribute, and a read(num_bytes=None) / write([content]) function. It also offers __iter__ functionality. You must open the file, and then wrap it with File() like:

myfile = File(open('myfile.txt', 'r'))


Twisted: http://twistedmatrix.com/documents/current/api/twisted.python.filepath.FilePath.html

Looking at twisted.python.filepath.FilePath, it looks like there is no read/write.


These are two very popular frameworks/libraries, but I'll see if I can't find other sources for inspiration.

I think read_bytes/read_text would offer a good alternative method for reading files, instead of trying to create a full-on replacement like the previous patches attempt to do.
History
Date User Action Args
2014-01-23 20:37:25cjwelbornsetrecipients: + cjwelborn, pitrou, cool-RR, serhiy.storchaka
2014-01-23 20:37:24cjwelbornsetmessageid: <1390509444.93.0.679704875938.issue20218@psf.upfronthosting.co.za>
2014-01-23 20:37:24cjwelbornlinkissue20218 messages
2014-01-23 20:37:24cjwelborncreate