title: pyinstaller seems not to find a data file
body: <p>Edit 3: I replaced <code>__file__</code> with <code>sys.argv[0]</code>, when I need to know the location of my script/executable. This is not exactly the same, but in my case it seems to run fine (at least on executable version...). Now everything is working fine, in one-file mode, with use of accepted answer's function to access resource files!</p>
  
  <hr>
  
  <p>Edit 2: as shown in accepted answer's comments, problem is coming from path resolution in my script; I try to use <code>__file__</code> to get the location of the script, so that I can access to its resource files. This does not work once packaged, as <code>__file__</code> will return filename from <code>Python.dll</code> to the script, so quite always no path and just a file name. So I have to find another trick to make access to resource files; a work-around for the moment is to move current directory to the executable path.</p>
  
  <p>By the way, this means that the ConfigParser should report problem when accessing the file, and not that a section is missing.</p>
  
  <p>I'll update this question with the way I resolved this path resolution question.</p>
  
  <hr>
  
  <p>I've got problems with <code>pyinstaller</code>, and as it's the first time I'm using it, it's sure that I've done something wrong.</p>
  
  <p>So, here's the problem: <code>pyisntaller</code> runs smoothly on a script I wrote, and generates some stuff in <code>dist</code> folder. Ok, so now I want to execute it to see if all went well, and here's what I get:</p>
  
  <pre><code>C:\Program Files\PyInstaller\pyinstaller-1.5.1&gt;p_tool\dist\p_tool\p_tool.exe -?
  Traceback (most recent call last):
    File "&lt;string&gt;", line 104, in &lt;module&gt;
    File "p_tool\build\pyi.win32\p_tool\outPYZ1.pyz/logging.config", line 76, in f
  ileConfig
    File "p_tool\build\pyi.win32\p_tool\outPYZ1.pyz/logging.config", line 112, in
  _create_formatters
    File "p_tool\build\pyi.win32\p_tool\outPYZ1.pyz/ConfigParser", line 532, in ge
  t
  ConfigParser.NoSectionError: No section: 'formatters'
  </code></pre>
  
  <p>My first idea was that the <code>logging.conf</code> file was missing, so I added it (and some other resource files) in the <code>p_tool.spec</code> file, but this is not better.</p>
  
  <p>Python version: 2.6.6, under WinXP. I'm using <code>pyinstaller</code> as I will need it to package files for a Solaris workstation.</p>
  
  <p>So, anyone did have this problem? The only topic related is the following question: <a href="https://stackoverflow.com/questions/6569896/pyinstaller-problem">PyInstaller Problem</a>, really close to my problem, but hopelessly it got no answer.</p>
  
  <hr>
  
  <p>Edit3: details about logging removed, as not really related to the problem.</p>