[1.8.2] ValueError: dictionary update sequence element #0 has length 1; 2 is required

Bug #1296178 reported by Maxime Chambreuil (http://www.savoirfairelinux.com)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP buildout recipe
Invalid
Undecided
Georges Racinet

Bug Description

Using the 1.8.2 recipe and OpenERP trunk branches, I am getting this error message building out :

Creating directory '/home/max/openerp/8.0/git/openerp/tools/bin'.
Creating directory '/home/max/openerp/8.0/git/openerp/tools/parts'.
Creating directory '/home/max/openerp/8.0/git/openerp/tools/eggs'.
Creating directory '/home/max/openerp/8.0/git/openerp/tools/develop-eggs'.
Generated script '/home/max/openerp/8.0/git/openerp/tools/bin/buildout'.
Getting distribution for 'cp.recipe.cmd==0.4'.
Got cp.recipe.cmd 0.4.
Getting distribution for 'zope.testing==4.1.1'.
warning: no files found matching '*.test' under directory 'src'
warning: no files found matching 'sampletests' under directory 'src'
Got zope.testing 4.1.1.
Getting distribution for 'zope.exceptions==4.0.1'.
Got zope.exceptions 4.0.1.
Getting distribution for 'anybox.recipe.openerp[bzr]==1.8.2'.
Got anybox.recipe.openerp 1.8.2.
Getting distribution for 'zc.recipe.egg>=2.0.0a3'.
Got zc.recipe.egg 2.0.1.
anybox.recipe.openerp.base: Created downloads/ directory
anybox.recipe.openerp.base: Created etc/ directory
While:
  Installing.
  Getting section dev.
  Initializing section dev.
  Getting option dev:addons.
  Getting section openerp.
  Initializing section openerp.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1942, in main
    getattr(buildout, command)(args)
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 506, in install
    [self[part]['recipe'] for part in install_parts]
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1094, in __getitem__
    options._initialize()
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1192, in _initialize
    self._dosub(k, v)
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1240, in _dosub
    v = '$$'.join([self._sub(s, seen) for s in v.split('$$')])
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1304, in _sub
    v = self.buildout[section].get(option, None, seen)
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1094, in __getitem__
    options._initialize()
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1198, in _initialize
    self.initialize()
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/zc.buildout-2.2.1-py2.7.egg/zc/buildout/buildout.py", line 1207, in initialize
    self.recipe = recipe_class(buildout, name, self)
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/anybox.recipe.openerp-1.8.2-py2.7.egg/anybox/recipe/openerp/server.py", line 41, in __init__
    super(ServerRecipe, self).__init__(*a, **kw)
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/anybox.recipe.openerp-1.8.2-py2.7.egg/anybox/recipe/openerp/base.py", line 168, in __init__
    self.parse_addons(options)
  File "/home/max/openerp/8.0/git/openerp/tools/eggs/anybox.recipe.openerp-1.8.2-py2.7.egg/anybox/recipe/openerp/base.py", line 459, in parse_addons
    options = dict(opt.split('=') for opt in split[spec_len:])
ValueError: dictionary update sequence element #0 has length 1; 2 is required

Related branches

Revision history for this message
Georges Racinet (gracinet) wrote :

Hi Maxime,

you most probably have a syntax problem in the 'addons' option. Maybe a missing destination directory or wished revision.
The recipe should catch an reraise this as a UserError.

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Here is my addons options. It works with version 1.7.3 of the recipe.

addons = bzr lp:openerp-web ../../../bzr/web last:1 subdir=addons
         bzr lp:openobject-addons ../../../bzr/addons last:1
         # bzr lp:openerp-canada/8.0 ../../../bzr/canada last:1
         local ../addons

Revision history for this message
Jean-Sébastien SUZANNE (jssuzanne) wrote :

Hi Maxime

Can you test without the comment line

Changed in anybox.recipe.openerp:
assignee: nobody → Georges Racinet (gracinet)
Revision history for this message
Georges Racinet (gracinet) wrote :

Thanks for the excerpt, I could reproduce this in the unit test I'm writting for the UserError rewrapping.

The culprit is the commented out line : one may not comment with a dash within an option (the whole is considered by buildout as a single line, hence this dash is not considered to be at the beginning of the line, which is in turn the only allowed case of dash commenting)

This is a common enough annoyance that I'm considering implementing the dash leading comments for this option. But that would create ambiguity for the other ones. There's already something similar in the 'revisions' option (semicolon end-of-line comments are directly supported)

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

I moved the dash to the start of the line and it is working now.

Thank you very much Georges.

Have a great day.

Revision history for this message
Georges Racinet (gracinet) wrote :

That was not really a bug. Still, a change has been done so that these kind of syntax problems don't look as bugs (now it's UserError).

Changed in anybox.recipe.openerp:
milestone: none → 1.8.3
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.