title: Error installing and running pywin32 2.7
body: <p>I am coming up with a couple errors after installing: </p>
  
  <blockquote>
    <p>pywin32-217.win32-py2.7</p>
  </blockquote>
  
  <p>I have recently upgraded ArcGIS to 10.1 and it uses Python 2.7 (as opposed to 2.6 that came with ArcGIS 10.0)</p>
  
  <p>When I run the installer on a Windows 7 64 bit, it installs, but throws the following message:</p>
  
  <blockquote>
    <p>close failed in file object destructor:</p>
    
    <p>sys.excepthook is missing</p>
    
    <p>lost sys.stderr</p>
  </blockquote>
  
  <p>I had a simple python script to print to a printer from a folder containing .pdf files which worked before my upgrade</p>
  
  <pre><code>import arcpy, glob, win32api, os
  
  pdfLoc = arcpy.GetParameterAsText(0)
  
  try:
      copies = int(arcpy.GetParameter(1))
  except:
      copies = 1
  
  for pdfname in glob.glob(os.path.join(pdfLoc, "*.pdf")):
      fullpath = os.path.join(pdfLoc, pdfname)
      for copy in range(copies):
          win32api.ShellExecute(0, "print", pdfname, None, ".", 0)
  
  del fullpath
  del pdfname
  del pdfLoc
  </code></pre>
  
  <p>Now when I run the script, I get the following error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File
    "Z:\ESRI\Python\Solstice_Tools_Scripts\Printer_Tools\Batch_Print_From_PDF_Only\BatchprintFromPDFOnly_Test.py",
    line 34, in 
        win32api.ShellExecute(0, "print", pdfname, None, ".", 0) error: (31, 'ShellExecute', 'A device attached to the system is not
    functioning.')</p>
    
    <p>Failed to execute (BatchPrintFromPDFOnly2).</p>
  </blockquote>
  
  <p>I've been googling around and have tried a few solutions, like running the executable in troubleshooting mode, but the error persists. Can anyone suggest what may cause this?</p>
  
  <p>As a side note, I upgraded 4 computers in my company to the new version of python and ArcGIS, and only one of them is throwing this error. The rest work fine.</p>
  
  <p>Thanks,
  Mike</p>