[New-bugs-announce] [issue12386] packaging fails in install_distinfo when writing RESOURCES

Vinay Sajip report at bugs.python.org
Wed Jun 22 13:22:25 CEST 2011


New submission from Vinay Sajip <vinay_sajip at yahoo.co.uk>:

This part of install_distinf.run():

    if install_data.get_resources_out() != []:
        resources_path = os.path.join(self.distinfo_dir,
                                      'RESOURCES')
        logger.info('creating %s', resources_path)
        with open(resources_path, 'wb') as f:
            writer = csv.writer(f, delimiter=',',
                                lineterminator='\n',
                                quotechar='"')
            for tuple in install_data.get_resources_out():
                writer.writerow(tuple)

fails at the writerow line:

creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/METADATA
creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/INSTALLER
creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/REQUESTED
creating /tmp/venv/lib/python3.3/site-packages/nemo-0.1.dist-info/RESOURCES
Traceback (most recent call last):
  File "/tmp/venv/bin/pysetup3", line 5, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.3/packaging/run.py", line 678, in main
    return dispatcher()
  File "/usr/local/lib/python3.3/packaging/run.py", line 667, in __call__
    return func(self, self.args)
  File "/usr/local/lib/python3.3/packaging/run.py", line 204, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.3/packaging/run.py", line 247, in _install
    if install_local_project(target):
  File "/usr/local/lib/python3.3/packaging/install.py", line 125, in install_local_project
    return _run_install_from_dir(path)
  File "/usr/local/lib/python3.3/packaging/install.py", line 160, in _run_install_from_dir
    func(source_dir)
  File "/usr/local/lib/python3.3/packaging/install.py", line 90, in _run_packaging_install
    dist.run_command('install_dist')
  File "/usr/local/lib/python3.3/packaging/dist.py", line 761, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.3/packaging/command/install_dist.py", line 526, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python3.3/packaging/command/cmd.py", line 329, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.3/packaging/dist.py", line 761, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.3/packaging/command/install_distinfo.py", line 116, in run
    writer.writerow(tuple)
TypeError: 'str' does not support the buffer interface


I think the open(resources_path) should use 'w' rather than 'wb' as the open mode.

Relevant part of setup.cfg:

resources =
    virtualenvwrapper.sh = {scripts}

I know I can put it in the scripts = section, but I'm testing having something in resources, which ought to work ...

----------
assignee: tarek
components: Distutils2, Library (Lib)
messages: 138821
nosy: alexis, eric.araujo, tarek, vinay.sajip
priority: normal
severity: normal
status: open
title: packaging fails in install_distinfo when writing RESOURCES
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12386>
_______________________________________


More information about the New-bugs-announce mailing list