Repository: conda/conda

Issue:
"conda" install or update throwing AttributeError: 'str' object has no attribute items
I've installed the last version of Anaconda3 with Python 3.6, which has the "conda" command version 4.3.14 on a Windows 7 without administrator rights to my account, but I could successfully install Anaconda in my <user>\appdata\local Windows folder.

When I try to install or update any package, I've got the following error:

```
`$ C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-script.py updat
e`

    Traceback (most recent call last):
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\exceptions.py", line 573, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_update.py", line 65, in execute
        install(args, parser, 'update')
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\install.py", line 130, in install
        context.validate_configuration()
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 838, in validate_configuration
        raise_errors(tuple(chain.from_iterable((errors, post_errors))))
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 836, in <genexpr>
        for name in self.parameter_names)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 829, in _collect_validation_error
        func(*args, **kwargs)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 447, in __get__
        result = typify_data_structure(self._merge(matches) if matches else self
.default,
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in _merge
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in <genexpr>
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\compat.py", line 71, in iteritems
        return iter(d.items(**kw))
    AttributeError: 'str' object has no attribute 'items'
```

Any hints?
"conda" install or update throwing AttributeError: 'str' object has no attribute items
I've installed the last version of Anaconda3 with Python 3.6, which has the "conda" command version 4.3.14 on a Windows 7 without administrator rights to my account, but I could successfully install Anaconda in my <user>\appdata\local Windows folder.

When I try to install or update any package, I've got the following error:

```
`$ C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-script.py updat
e`

    Traceback (most recent call last):
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\exceptions.py", line 573, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_update.py", line 65, in execute
        install(args, parser, 'update')
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\install.py", line 130, in install
        context.validate_configuration()
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 838, in validate_configuration
        raise_errors(tuple(chain.from_iterable((errors, post_errors))))
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 836, in <genexpr>
        for name in self.parameter_names)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 829, in _collect_validation_error
        func(*args, **kwargs)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 447, in __get__
        result = typify_data_structure(self._merge(matches) if matches else self
.default,
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in _merge
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in <genexpr>
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\compat.py", line 71, in iteritems
        return iter(d.items(**kw))
    AttributeError: 'str' object has no attribute 'items'
```

Any hints?


Discussion:
@srodriguex Could you please share the output for `conda info -a`?
@nehaljwani Here you go:

```
C:\Users\<username>>conda info -a
Current conda install:

               platform : win-64
          conda version : 4.3.14
       conda is private : False
      conda-env version : 4.3.14
    conda-build version : not installed
         python version : 3.6.0.final.0
       requests version : 2.12.4
       root environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3  (wri
able)
    default environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3
       envs directories : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\envs
                          C:\Users\<username>\AppData\Local\conda\conda\envs
                          C:\Users\<username>\.conda\envs
          package cache : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\pkgs
                          C:\Users\<username>\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/anaconda-fusion/win-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\<username>\.condarc
           offline mode : False
             user-agent : conda/4.3.14 requests/2.12.4 CPython/3.6.0 Windows/7
indows/6.1.7601

# conda environments:
#
root                  *  C:\Users\<username>\AppData\Local\Continuum\Anaconda3

sys.version: 3.6.0 |Anaconda 4.3.1 (64-bit)| (default...
sys.prefix: C:\Users\<username>\AppData\Local\Continuum\Anaconda3
sys.executable: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\python.exe
conda location: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packag
s\conda
conda-build: None
conda-env: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-env.ex

conda-server: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-ser
er.exe
user site dirs:

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
PATH: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Library\bin;C:\oracle\pro
uct\11.2.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\IXOS\bin;C:\Users\<username>\AppData\Local\Continuum\Anaconda3
C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts;C:\Users\<username>\AppData\L
cal\Continuum\Anaconda3\Library\bin;c:\users\<username>\bin
PYTHONHOME: <not set>
PYTHONPATH: <not set>

License directories:
    C:\Users\<username>\.continuum
    C:\Users\<username>\AppData\Local\Continuum\Anaconda3\licenses
    C:\Users\<username>\AppData\Roaming\Continuum
License files (license*.txt):
Package/feature end dates:

```
@srodriguex Could you also share output for: `conda config --show`
@nehaljwani Right away sir:

```
C:\Users\<username>>conda config --show
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.3.14
       conda is private : False
      conda-env version : 4.3.14
    conda-build version : not installed
         python version : 3.6.0.final.0
       requests version : 2.12.4
       root environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3  (writ
able)
    default environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3
       envs directories : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\envs
                          C:\Users\<username>\AppData\Local\conda\conda\envs
                          C:\Users\<username>\.conda\envs
          package cache : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\pkgs
                          C:\Users\<username>\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/anaconda-fusion/win-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\<username>\.condarc
           offline mode : False
             user-agent : conda/4.3.14 requests/2.12.4 CPython/3.6.0 Windows/7 W
indows/6.1.7601



`$ C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-script.py confi
g --show`




    Traceback (most recent call last):
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\exceptions.py", line 573, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_config.py", line 234, in execute
        execute_config(args, parser)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_config.py", line 308, in execute_config
        'verbosity',
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_config.py", line 279, in <genexpr>
        for key in sorted(('add_anaconda_token',
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 447, in __get__
        result = typify_data_structure(self._merge(matches) if matches else self
.default,
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in _merge
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in <genexpr>
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\compat.py", line 71, in iteritems
        return iter(d.items(**kw))
    AttributeError: 'str' object has no attribute 'items'

```

Does `conda config --show-sources` also error?
And also `conda config --validate`?
I am able to reproduce the exact same error when, for any of of the config parameters , I pass a string instead of the expected list or key pair value. Example, if I have:

```
proxy_servers: http://blah.com:3128
```
Instead of:
```
proxy_servers:
  http: http://blah.com:3128
```
In the above scenario, `conda config --show-sources` throws the exception (expected): 
```
InvalidTypeError: Parameter proxy_servers = 'http://blah.com:3128' declared in <<merged>> has type <class 'str'>.
Valid types:   - <class 'dict'>.
```

But `conda config --show` throws a traceback instead of exception.
@kalefranz Here are your answers:

````
C:\Users\<username>>conda config --show-sources

InvalidTypeError: Parameter proxy_servers = 'http:127.0.0.1:53128' declared in <
<merged>> has type <class 'str'>.
Valid types:   - <class 'dict'>.
````

and

````
C:\Users\cmsi>conda --validate
usage: conda-script.py [-h] [-V] command ...
conda-script.py: error: the following arguments are required: command
````
Here you have my .condarc file, I'm behind a proxy so I'm using a CNTLM proxy wrapper:

````
proxy_servers: http:127.0.0.1:53128
channels:
  - anaconda-fusion
  - defaults
ssl_verify: true
````
@srodriguex Replace... 
```
proxy_servers: http:127.0.0.1:53128
```
...with:
```
proxy_servers:
   http: http://127.0.0.1:53128
   https: http://127.0.0.1:53128
```
@nehaljwani The substitution works setting the "ssl_verify" to "false".  So the problem was in the .condarc file... I was almost pretty sure I followed the [documentation for proxy configuration](https://conda.io/docs/config.html#configure-conda-for-use-behind-a-proxy-server-proxy-servers), but I have forgotten enclosing with the (') character. 
Labelled this issue as a bug.  PR coming for a better error message.
@srodriguex Could you please share the output for `conda info -a`?
@nehaljwani Here you go:

```
C:\Users\<username>>conda info -a
Current conda install:

               platform : win-64
          conda version : 4.3.14
       conda is private : False
      conda-env version : 4.3.14
    conda-build version : not installed
         python version : 3.6.0.final.0
       requests version : 2.12.4
       root environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3  (wri
able)
    default environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3
       envs directories : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\envs
                          C:\Users\<username>\AppData\Local\conda\conda\envs
                          C:\Users\<username>\.conda\envs
          package cache : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\pkgs
                          C:\Users\<username>\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/anaconda-fusion/win-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\<username>\.condarc
           offline mode : False
             user-agent : conda/4.3.14 requests/2.12.4 CPython/3.6.0 Windows/7
indows/6.1.7601

# conda environments:
#
root                  *  C:\Users\<username>\AppData\Local\Continuum\Anaconda3

sys.version: 3.6.0 |Anaconda 4.3.1 (64-bit)| (default...
sys.prefix: C:\Users\<username>\AppData\Local\Continuum\Anaconda3
sys.executable: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\python.exe
conda location: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packag
s\conda
conda-build: None
conda-env: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-env.ex

conda-server: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-ser
er.exe
user site dirs:

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
PATH: C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Library\bin;C:\oracle\pro
uct\11.2.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\IXOS\bin;C:\Users\<username>\AppData\Local\Continuum\Anaconda3
C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts;C:\Users\<username>\AppData\L
cal\Continuum\Anaconda3\Library\bin;c:\users\<username>\bin
PYTHONHOME: <not set>
PYTHONPATH: <not set>

License directories:
    C:\Users\<username>\.continuum
    C:\Users\<username>\AppData\Local\Continuum\Anaconda3\licenses
    C:\Users\<username>\AppData\Roaming\Continuum
License files (license*.txt):
Package/feature end dates:

```
@srodriguex Could you also share output for: `conda config --show`
@nehaljwani Right away sir:

```
C:\Users\<username>>conda config --show
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

    https://github.com/conda/conda/issues



Current conda install:

               platform : win-64
          conda version : 4.3.14
       conda is private : False
      conda-env version : 4.3.14
    conda-build version : not installed
         python version : 3.6.0.final.0
       requests version : 2.12.4
       root environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3  (writ
able)
    default environment : C:\Users\<username>\AppData\Local\Continuum\Anaconda3
       envs directories : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\envs
                          C:\Users\<username>\AppData\Local\conda\conda\envs
                          C:\Users\<username>\.conda\envs
          package cache : C:\Users\<username>\AppData\Local\Continuum\Anaconda3\pkgs
                          C:\Users\<username>\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/anaconda-fusion/win-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\<username>\.condarc
           offline mode : False
             user-agent : conda/4.3.14 requests/2.12.4 CPython/3.6.0 Windows/7 W
indows/6.1.7601



`$ C:\Users\<username>\AppData\Local\Continuum\Anaconda3\Scripts\conda-script.py confi
g --show`




    Traceback (most recent call last):
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\exceptions.py", line 573, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_config.py", line 234, in execute
        execute_config(args, parser)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_config.py", line 308, in execute_config
        'verbosity',
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\cli\main_config.py", line 279, in <genexpr>
        for key in sorted(('add_anaconda_token',
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 447, in __get__
        result = typify_data_structure(self._merge(matches) if matches else self
.default,
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in _merge
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\configuration.py", line 664, in <genexpr>
        for match in relevant_matches)
      File "C:\Users\<username>\AppData\Local\Continuum\Anaconda3\lib\site-packages\co
nda\common\compat.py", line 71, in iteritems
        return iter(d.items(**kw))
    AttributeError: 'str' object has no attribute 'items'

```

Does `conda config --show-sources` also error?
And also `conda config --validate`?
I am able to reproduce the exact same error when, for any of of the config parameters , I pass a string instead of the expected list or key pair value. Example, if I have:

```
proxy_servers: http://blah.com:3128
```
Instead of:
```
proxy_servers:
  http: http://blah.com:3128
```
In the above scenario, `conda config --show-sources` throws the exception (expected): 
```
InvalidTypeError: Parameter proxy_servers = 'http://blah.com:3128' declared in <<merged>> has type <class 'str'>.
Valid types:   - <class 'dict'>.
```

But `conda config --show` throws a traceback instead of exception.
@kalefranz Here are your answers:

````
C:\Users\<username>>conda config --show-sources

InvalidTypeError: Parameter proxy_servers = 'http:127.0.0.1:53128' declared in <
<merged>> has type <class 'str'>.
Valid types:   - <class 'dict'>.
````

and

````
C:\Users\cmsi>conda --validate
usage: conda-script.py [-h] [-V] command ...
conda-script.py: error: the following arguments are required: command
````
Here you have my .condarc file, I'm behind a proxy so I'm using a CNTLM proxy wrapper:

````
proxy_servers: http:127.0.0.1:53128
channels:
  - anaconda-fusion
  - defaults
ssl_verify: true
````
@srodriguex Replace... 
```
proxy_servers: http:127.0.0.1:53128
```
...with:
```
proxy_servers:
   http: http://127.0.0.1:53128
   https: http://127.0.0.1:53128
```
@nehaljwani The substitution works setting the "ssl_verify" to "false".  So the problem was in the .condarc file... I was almost pretty sure I followed the [documentation for proxy configuration](https://conda.io/docs/config.html#configure-conda-for-use-behind-a-proxy-server-proxy-servers), but I have forgotten enclosing with the (') character. 
Labelled this issue as a bug.  PR coming for a better error message.

Resolving patch:
diff --git a/conda/common/configuration.py b/conda/common/configuration.py
--- a/conda/common/configuration.py
+++ b/conda/common/configuration.py
@@ -105,7 +105,7 @@ def __init__(self, parameter_name, parameter_value, source, wrong_type, valid_ty
         self.valid_types = valid_types
         if msg is None:
             msg = ("Parameter %s = %r declared in %s has type %s.\n"
-                   "Valid types: %s." % (parameter_name, parameter_value,
+                   "Valid types:\n%s" % (parameter_name, parameter_value,
                                          source, wrong_type, pretty_list(valid_types)))
         super(InvalidTypeError, self).__init__(parameter_name, parameter_value, source, msg=msg)
 
@@ -654,18 +654,23 @@ def collect_errors(self, instance, value, source="<<merged>>"):
     def _merge(self, matches):
         # get matches up to and including first important_match
         #   but if no important_match, then all matches are important_matches
-        relevant_matches = self._first_important_matches(matches)
+        relevant_matches_and_values = tuple((match, match.value(self)) for match in
+                                            self._first_important_matches(matches))
+        for match, value in relevant_matches_and_values:
+            if not isinstance(value, Mapping):
+                raise InvalidTypeError(self.name, value, match.source, value.__class__.__name__,
+                                       self._type.__name__)
 
         # mapkeys with important matches
         def key_is_important(match, key):
             return match.valueflags(self).get(key) is ParameterFlag.final
         important_maps = tuple(dict((k, v)
-                                    for k, v in iteritems(match.value(self))
+                                    for k, v in iteritems(match_value)
                                     if key_is_important(match, k))
-                               for match in relevant_matches)
+                               for match, match_value in relevant_matches_and_values)
         # dump all matches in a dict
         # then overwrite with important matches
-        return merge(concatv((m.value(self) for m in relevant_matches),
+        return merge(concatv((v for _, v in relevant_matches_and_values),
                              reversed(important_maps)))
 
     def repr_raw(self, raw_parameter):


Test patch:
diff --git a/tests/common/test_configuration.py b/tests/common/test_configuration.py
--- a/tests/common/test_configuration.py
+++ b/tests/common/test_configuration.py
@@ -424,7 +424,11 @@ def test_config_resets(self):
             assert config.changeps1 is False
 
     def test_empty_map_parameter(self):
-
         config = SampleConfiguration()._set_raw_data(load_from_string_data('bad_boolean_map'))
         config.check_source('bad_boolean_map')
 
+    def test_invalid_map_parameter(self):
+        data = odict(s1=YamlRawParameter.make_raw_parameters('s1', {'proxy_servers': 'blah'}))
+        config = SampleConfiguration()._set_raw_data(data)
+        with raises(InvalidTypeError):
+            config.proxy_servers