buildout / buildout

Buildout is a deployment automation tool written in and extended with Python
http://www.buildout.org
Other
570 stars 168 forks source link

Get rid of that ValueError: need more than 0 values to unpack #636

Open tobiasherp opened 5 months ago

tobiasherp commented 5 months ago

Sometimes a package won't install, and I get a pretty ugly error:

Traceback (most recent call last):
  ...
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 688, in install
    for dist in self._get_dist(requirement, ws):
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 580, in _get_dist
    dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1762, in _move_to_eggs_dir_and_compile
    [tmp_loc] = glob.glob(os.path.join(tmp_dest, '*'))
ValueError: need more than 0 values to unpack

Can we please have a more useful information, e.g.:

Traceback (most recent call last):
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 688, in install
    for dist in self._get_dist(requirement, ws):
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 580, in _get_dist
    dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1763, in _move_to_eggs_dir_and_compile
    tmp_loc = single_entry_in_dir(tmp_dest)
  File "/my/instance/root/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1718, in single_entry_in_dir
    raise ValueError('Directory %s missing or empty!' % dn)
ValueError: Directory /my/common/eggs/tmpizfSst missing or empty!

I'd be willing to provide that single_entry_in_dir function, if necessary. Of course, this won't be sufficient in many cases; the logfile (#635) would be important as well.

I use the most recent zc.buildout version whenever I can, but I still have Python 2.7 and Plone 4.3, so I'd like to have this in a 2.13.x release as well.

gotcha commented 5 months ago

Any PR welcome.

Did you try to use buildout 3.0.x with Python 2.7 and Plone 4.3 ? It is supposed to work fine.

mauritsvanrees commented 1 month ago

The mr.developer Buildout extension had the same problem, and I merged the PR with the fix yesterday. Available in mr.developer 2.0.2. Maybe that can inspire a solution.