Antoine Pitrou <pit...@free.fr> added the comment:

I'm not comfortable with the following change (which appears twice in
the patch):

-                       BZ2_bzReadClose(&bzerror, self->fp);
+                       if (self->fp)
+                               BZ2_bzReadClose(&bzerror, self->fp);
                        break;
                case MODE_WRITE:
-                       BZ2_bzWriteClose(&bzerror, self->fp,
-                                        0, NULL, NULL);
+                       if (self->fp)
+                               BZ2_bzWriteClose(&bzerror, self->fp,
+                                                0, NULL, NULL);


If you need to test for the file pointer, perhaps there's a logic flaw
in your patch. Also, it might be dangerous in write mode: could it occur
that the file isn't closed but the problem isn't reported?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1625>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to