Closed ronaldoussoren closed 11 years ago
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren).
Ensure that the result of zipio.open can be used in a with statement
Fixes issue #10.
Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren).
Thanks for the report!
Original report by James Kruth (Bitbucket: artlogic, GitHub: artlogic).
In python 2, StringIO does not implement the context handler protocol. In py2app, calls to zipio.open assume that a context handler is present.
This is fairly easily fixed by doing a version check, and if on python 2, changing the following lines to:
You'll of course have to import contextlib as well.