Created
May 30, 2012 00:00
-
-
Save TkTech/2831547 to your computer and use it in GitHub Desktop.
test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================================== | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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