On Thu, 2009-01-29 at 15:40 -0500, Todd O'Bryan wrote: > I'm trying to validate an uploaded csv file, so I want to read the > first line of text and if it's not the right format, send an error > message. Unfortunately, neither InMemoryUploadedFile nor > TemporaryUploadedFile have the readline() method. > > Was that an oversight (in which case I'll create a two-line patch and > submit it--both StringIO and temp files support the method) or a > design decision with a good reason?
It's a flaw in Python: what an object needs to be "file-like" is not well defined. Different users require different things. A file doesn't really need a readlines() method, except when it does, etc. There's about half a dozen tickets open for "add X, Y or Z" to the file stuff, so look through those first. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---