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 vstinner
Recipients Level, ned.deily, serhiy.storchaka, vstinner
Date 2013-12-03.21:01:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386104516.79.0.679265265186.issue19878@psf.upfronthosting.co.za>
In-reply-to
Content
I can reproduce the issue with Python 2.7. The problem is that BZ2File.__init__() doesn't reset the object when __init__() is called twice.

For example, the following script fails with "too many open files" error, before the previous file is not called:
---
import bz2
obj = bz2.BZ2File('bla.bz2')
for loop in range(1024*10):
    obj.__init__('bla.bz2')
---

By the way, why do you call __init__() twice? Why not creating a new object?

BZ2File was rewritten in pure Python in Python 3.3. Python 3.3+ is not affected by this issue.
History
Date User Action Args
2013-12-03 21:01:56vstinnersetrecipients: + vstinner, ned.deily, serhiy.storchaka, Level
2013-12-03 21:01:56vstinnersetmessageid: <1386104516.79.0.679265265186.issue19878@psf.upfronthosting.co.za>
2013-12-03 21:01:56vstinnerlinkissue19878 messages
2013-12-03 21:01:56vstinnercreate