FlorianRhiem / pyGLFW

Python bindings for GLFW
MIT License
233 stars 36 forks source link

"import glfw" fails in "subprocess.py" when using Python 3 (but not Python 2) #4

Closed miloszrolinski closed 10 years ago

miloszrolinski commented 10 years ago

When I try to import pyGLFW, the import fails in "subprocess.py" because it tries to use encode on a bytes-type object. This does not happen in Python 2.7.5 on the same machine.

Python 3.3.2 (default, Jun 30 2014, 17:20:03) [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux Type "help", "copyright", "credits" or "license" for more information.

import glfw Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.3/site-packages/glfw.py", line 138, in ['', '/usr/lib', '/usr/local/lib'], _glfw_get_version) File "/usr/lib/python3.3/site-packages/glfw.py", line 74, in _load_library version = version_check_callback(filename) File "/usr/lib/python3.3/site-packages/glfw.py", line 130, in _glfw_get_version out = process.communicate(_to_char_p(filename))[0] File "/usr/lib64/python3.3/subprocess.py", line 922, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/usr/lib64/python3.3/subprocess.py", line 1546, in _communicate orig_timeout) File "/usr/lib64/python3.3/subprocess.py", line 1619, in _communicate_with_poll self._save_input(input) File "/usr/lib64/python3.3/subprocess.py", line 1580, in _save_input self._input = self._input.encode(self.stdin.encoding) AttributeError: 'bytes' object has no attribute 'encode'

FlorianRhiem commented 10 years ago

Hello, thank you for reporting this! I think the commit f2c1d73 should fix this. Can you please try again with the current version? Thanks!

miloszrolinski commented 10 years ago

Hi, Thank you for the quick response :) I can confirm this works now.