1. Tarek Ziadé
  2. distribute
  3. Issues
Issue #108 open

TypeError with Python3.1

Laurent Gautier
created an issue

The same setup.py works fine with Python 2.6 (python setup.py install), and it fails with Python 3.1.


Traceback (most recent call last): File "setup.py", line 292, in <module> [os.path.join('doc', 'source', 'rpy2_logo.png')])] File "/usr/lib/python3.1/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib/python3.1/distutils/dist.py", line 919, in run_commands self.run_command(cmd) File "/usr/lib/python3.1/distutils/dist.py", line 938, in run_command cmd_obj.run() File "/usr/local/packages/python/python-3.1/lib/python3.1/site-packages/distribute-0.6.10-py3.1.egg/setuptools/command/install.py", line 73, in run self.do_egg_install() File "/usr/local/packages/python/python-3.1/lib/python3.1/site-packages/distribute-0.6.10-py3.1.egg/setuptools/command/install.py", line 101, in do_egg_install cmd.run() File "/usr/local/packages/python/python-3.1/lib/python3.1/site-packages/distribute-0.6.10-py3.1.egg/setuptools/command/easy_install.py", line 236, in run self.easy_install(spec, not self.no_deps) File "/usr/local/packages/python/python-3.1/lib/python3.1/site-packages/distribute-0.6.10-py3.1.egg/setuptools/command/easy_install.py", line 439, in easy_install if not self.editable: self.install_site_py() File "/usr/local/packages/python/python-3.1/lib/python3.1/site-packages/distribute-0.6.10-py3.1.egg/setuptools/command/easy_install.py", line 1108, in install_site_py if not current.startswith('def __boot():'): TypeError: expected an object with the buffer interface


Comments (8)

  1. Tarek Ziadé repo owner
    • changed status to open

    That's because the file is open in binary mode. In python 3 read() returns bytes in that case.

    I can safely decode it to a str since this file is pure ascii.

  2. Laurent Gautier reporter
    • changed status to open

    "I can safely decode it to a str since this file is pure ascii."

    The file causing trouble seems to be a .png data file file. In the call to setup, that's

     data_files = [(os.path.join('rpy2', 'images'), 
                       [os.path.join('doc', 'source', 'rpy2_logo.png')])]
  3. Anonymous
  4. Log in to comment