As stated in the subject, I am running linux with python3.4 and all of the examples are failing with the following error:
Traceback (most recent call last):
File "30_renderer_dirty.py", line 41, in <module>
import gummworld2
File "../gamelib/gummworld2/__init__.py", line 42, in <module>
sys.stdout = os.fdopen(sys.stdout.fileno(), 'a', buf_arg)
File "/usr/lib/python3.4/os.py", line 980, in fdopen
return io.open(fd, *args, **kwargs)
OSError: [Errno 29] Illegal seek
Gummworld2 was downloaded yesterday on 1/27. Filename: gummbum-gummworld2-9c672c159962.zip
I started learning python (and tcl) last summer and just recently started learning pygame primarily using the books at
inventwithpython.com. So... despite my time on google, I wasn't able to figure out what is wrong. I'm hoping someone here does though I believe you are developing on windows. at least I think I saw a post somewhere. Anyway, here's the code from __init__.py for your convenience:
import os
import sys
# Unbuffered IO for Python 2.6, 2.7, and 3.x
buf_arg = 0
if sys.version_info[0] == 3:
buf_arg = 1
os.environ['PYTHONUNBUFFERED'] = '1'
sys.stdout.flush()
sys.stderr.flush()
sys.stdout = os.fdopen(sys.stdout.fileno(), 'a', buf_arg)
sys.stderr = os.fdopen(sys.stderr.fileno(), 'a', buf_arg)
I've tried tweaking the code but no luck. I was able to comment the entire section out and run the examples.
btw: if I'm understanding it correctly, you are turning of the stream buffering for the stdout and stderr streams. Why?
Thank you,
Jay