Skip to content

Instantly share code, notes, and snippets.

@TkTech
Created May 30, 2012 00:00
Show Gist options
  • Save TkTech/2831547 to your computer and use it in GitHub Desktop.
Save TkTech/2831547 to your computer and use it in GitHub Desktop.
test.py
======================================================================
ERROR: test_save (__main__.CreationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/creation_test.py", line 35, in test_save
self.nbt.save('__test__.nbt')
File "/home/tyler/Projects/PyNBT/pynbt/nbt.py", line 307, in save
g = gzip.GzipFile(fileobj=f, mode='wb') if compressed else f
File "/usr/lib/python3.2/gzip.py", line 201, in __init__
self._write_gzip_header()
File "/usr/lib/python3.2/gzip.py", line 233, in _write_gzip_header
self.fileobj.write(b'\037\213') # magic header
io.UnsupportedOperation: write
f = io if hasattr(io, 'read') else open(io, 'rb')
g = gzip.GzipFile(fileobj=f, mode='wb') if compressed else f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment