title: Python's "open()" throws different errors for "file not found" - how to handle both exceptions?
body: <p>I have a script where a user is prompted to type a filename (of a file that is to be opened), and if the file doesn't exist in the current directory, the user is prompted again. Here is the short version:</p>
  
  <pre><code>file = input("Type filename: ")
  
  ...
  try:
      fileContent = open(filename, "r")
      ...
  except FileNotFoundError:
      ...
  </code></pre>
  
  <p>When I tested my script on my MacOS X in Python 3.3x it worked perfectly fine when I type the wrong filename on purpose (it executes the suite under "expect").</p>
  
  <p>However, when I wanted to run my code
  on a Windows computer in Python 3.2x, I get an error that says that  "FileNotFoundError" is not defined. So, Python 3.2 on Windows thinks "FileNotFoundError" is a variable and the programs quits with an error. </p>
  
  <p>I figured out that Python 3.2 on Windows throws an "IOError" if the input filename is not valid. I tested it on my Linux machine in Python 2.7, and it's also an IOError. </p>
  
  <p>My problem is now, that the code with </p>
  
  <pre><code>except "FileNotFoundError":
  </code></pre>
  
  <p>won't run on Windows's Python 3.2, but if I change it to </p>
  
  <pre><code>except "IOError":
  </code></pre>
  
  <p>it won't work on my Mac anymore.</p>
  
  <p>How could I work around it? The only way I can think of is to use just
  <code>except</code>, which I usually don't want.</p>