This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients akuchling, dbonner, niemeyer, pitrou, r.david.murray, therve, thomaslee
Date 2009-10-24.18:44:19
SpamBayes Score 0.0020801753
Marked as misclassified No
Message-id <1256409860.53.0.080081439536.issue1625@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2009-10-24 18:44:20pitrousetrecipients: + pitrou, akuchling, niemeyer, therve, thomaslee, r.david.murray, dbonner
2009-10-24 18:44:20pitrousetmessageid: <1256409860.53.0.080081439536.issue1625@psf.upfronthosting.co.za>
2009-10-24 18:44:19pitroulinkissue1625 messages
2009-10-24 18:44:19pitroucreate