[issue10392] GZipFile crash when fileobj.mode is None

2010-11-13 Thread Brad Greenlee
Brad Greenlee added the comment: Understood. I just felt that fileobj.mode == None should be handled the same way that GzipFile(...,mode=None) is handled. I've submitted a patch to Django: http://code.djangoproject.com/ticket/14681 -- ___ P

[issue10392] GZipFile crash when fileobj.mode is None

2010-11-12 Thread Brad Greenlee
Brad Greenlee added the comment: Yes, but if I actually passed mode=None in, the behavior would be the same, no? -- ___ Python tracker <http://bugs.python.org/issue10

[issue10392] GZipFile crash when fileobj.mode is None

2010-11-12 Thread Brad Greenlee
Brad Greenlee added the comment: GzipFile.__init__ considers mode == None to be the equivalent of undefined, and sets it to the default of 'rb'. I see fileobj.mode == None as the same thing. That said, it is probably a bug in Django as well; I'll look into that. I still thin

[issue10392] GZipFile crash when fileobj.mode is None

2010-11-11 Thread Brad Greenlee
New submission from Brad Greenlee : If GZipFile.__init_ is passed a fileobj that has a mode attribute set to None, it will crash with a "'NoneType' object is unsubscriptable" error when it tries to read the first character of the mode. I ran across this when trying