title: Python: os.listdir files are not found
body: <p>I recently moved my config files to another folder in my Project. I try to load the like this:</p>
  
  <pre><code>CONFIG_PATH = os.path.abspath(os.path.dirname(os.path.abspath(__file__))+"/../config/")    
  
  def load_config():
      configs = {}
      for config in os.listdir(CONFIG_PATH):
          configs[str(config)[0:-12]] = json.load(open(config))
      return configs
  </code></pre>
  
  <p>I'm running the code from</p>
  
  <pre><code>D:/.../MyProject/src
  </code></pre>
  
  <p>And the specified <code>CONFIGPATH</code> is correctly set to</p>
  
  <pre><code>D:/.../MyProject/config
  </code></pre>
  
  <p>Now in that iteration loop, the <code>open(config)</code> raises an exception:</p>
  
  <pre><code>FileNotFoundError: [Errno 2] No such file or directory: 'sample.config.json'
  </code></pre>
  
  <p>I can't see why my program can't open a file, which clearly has to exist since it is given out by <code>os.listdir</code>. Actually, a <code>print(config)</code> in the loop confirms that there is a file with that name. So why won't it open and instead raises a FileNotFoundError?</p>
  
  <p>Do I miss the obvious here? The code worked before I moved the files upwards. I'm working with Pycharm on Windows 7, if that is of any relevance.</p>