mnooner256 / pyqrcode

Python 3 module to generate QR Codes
BSD 3-Clause "New" or "Revised" License
408 stars 75 forks source link

Using a writeable stream #7

Closed ediazpacheco closed 9 years ago

ediazpacheco commented 9 years ago

Under Python 2.7.6 I get:

Traceback (most recent call last): File "", line 6, in ValueError: I/O operation on closed file.

using the code:

import pyqrcode from io import BytesIO qr = pyqrcode.create("my qr string", mode='binary', version=7) f=BytesIO() qr.png(f, scale=4) f.getvalue()

The code runs fine if I save the file to disk using:

qr.png("myqr.png", scale=4)

I tried hard to debug this but I can't find where the stream is being closed and there is not any .close() statement for the stream. [1]

ediazpacheco commented 9 years ago

Ops, I see that is a probem resolved here: https://github.com/mnooner256/pyqrcode/pull/6