Changeset 463

Show
Ignore:
Timestamp:
Fri May 16 05:41:54 2008
Author:
naufraghi
Message:

Merged revisions 461-462 via svnmerge from
https://svn.pyinstaller.python-hosting.com/trunk[[BR]]
........

r462 | giovannibajo | 2008-05-15 18:45:15 +0200 (Thu, 15 May 2008) | 2 lines

Fix random exception (IOError) in non-console mode when using prints
........

Files:

Legend:

Unmodified
Added
Removed
Modified
  • branches/crypt/doc/CHANGES.txt

    r459 r463  
    34 34    is not a valid code object".  
    35 35  + Fix problem when having unicode strings among path elements.  
      36  + Fix random exception ("bad file descriptor") with "prints" in non-console  
      37    mode (actually a pythonw "bug" that's fixed in Python 3.0).  
      38  
    36 39  
    37 40 PyInstaller 1.3  
  • branches/crypt/support/_mountzlib.py

    r455 r463  
    29 29 if not hasattr(sys, 'frozen'):  
    30 30     sys.frozen = 1  
      31 # Implement workaround for prints in non-console mode. In non-console mode  
      32 # (with "pythonw"), print randomically fails with "[errno 9] Bad file descriptor"  
      33 # when the printed text is flushed (eg: buffer full); this is because the  
      34 # sys.stdout object is bound to an invalid file descriptor.  
      35 # Python 3000 has a fix for it (http://bugs.python.org/issue1415), but we  
      36 # feel that a workaround in PyInstaller is a good thing since most people  
      37 # found this problem for the first time with PyInstaller as they don't  
      38 # usually run their code with "pythonw" (and it's hard to debug anyway).  
      39 class NullWriter:  
      40     def write(*args): pass  
      41     def flush(*args): pass  
      42 if sys.stdout.fileno() < 0:  
      43     sys.stdout = NullWriter()  
      44 if sys.stderr.fileno() < 0:  
      45     sys.stderr = NullWriter()