title: Open symbolic link file as rb, and not the file it is pointing to. (or generating it in buffer)
body: <p>How could I possible open a symbolic link and get the content of the file instead of the file it is pointing to?</p>
  
  <p>By doing:</p>
  
  <pre><code>with open('/home/symlink.txt', 'rb') as f:
      data=f.read()
  </code></pre>
  
  <p>If the symbolic link points to <code>/foo/faa.txt</code>, the variable <code>data</code> will contain the content of <code>faa.txt</code>. This is a big security and file problem from my server because I'm generating zip archives.</p>
  
  <p>If for example, a folder contains multiple symbolic links with different names to avoid duplicating files, the zip archive will contain multiple files instead of multiple symbolic links!</p>
  
  <p>I hope to be clear enough!</p>
  
  <hr>
  
  <p>An extra explanation:</p>
  
  <p>The point of this is to allow downloading symlinks in a django server. The way of returning files is the following one:</p>
  
  <pre><code>response = HttpResponse()
  response.write(data))
  return response
  </code></pre>
  
  <p>This means that <code>data</code> must contain the content that the user will download. I can not just give it a path. So what I need to do is to give it a symbolic link. The problem is that reading a symbolic link makes python read the content where it is pointing to instead of its real content. In a few words, the user downloads the real file instead of the symbolic link!</p>
  
  <hr>
  
  <p>A possible solution to this would be to get the path where the symlink points to, and then generate the link in the buffer. Is this possible?</p>