title: Python Multiprocessing DictProxy append to dict of list not working
body: <p>I am writing a program that uses a multiprocessing.managers.DictProxy. The program traverses a directory, and creates a dict with username as the key obtained by <code>pwd.getpwuid(os.stat(file)[4])[0]</code>, and the corresponding value to the key would be a list that contains the files owned by that user. Eg for the supposed datastructure:</p>
  
  <pre><code>{'root': ["/boot/vmlinuz", "/boot/grub"], 'testuser': ["/home/testuser", "/home/testuser/.bashrc"]}
  </code></pre>
  
  <p>The code I wrote to do this is</p>
  
  <pre><code>#!/usr/bin/python
  import os
  import multiprocessing
  import sys
  import pwd
  import grp
  manager_attributes = multiprocessing.Manager()
  file_stats_user = manager_attributes.dict()    
  def filestat(file):
    try:
        stat = os.stat(file)
        user = pwd.getpwuid(stat[4])[0]
        group = grp.getgrgid(stat[5])[0]
        if user not in file_stats_user:
            file_stats_user[user] = []
        file_stats_user[user].append(file)
    except OSError, e:
        print e
  
  try:
      cores = (multiprocessing.cpu_count()*2)
  except:
      cores = 8
  print "Starting parallel execution with ", cores, "concurrency"
  pool_get_attributes = multiprocessing.Pool(cores)
  pool_get_attributes.map(filestat, files)
  pool_get_attributes.close()
  pool_get_attributes.join()
  </code></pre>
  
  <p>where files is a list of all the files obtained.</p>
  
  <p>However, when I am printing the file_stats_user which is a multiprocessing.managers.DictProxy object, I am getting the keys, but the list values are empty, as </p>
  
  <pre><code>{'root': [], 'testuser': []}
  </code></pre>
  
  <p><code>file_stats_user[user].append(file)</code> is not appending the file name to the respective key.
  What am I doing wrong here? </p>
  
  <p>Thank you.</p>