[PyQt] Bug in latest driver.py file

Phil Thompson phil at riverbankcomputing.com
Mon Sep 20 14:23:45 BST 2010


On Mon, 20 Sep 2010 09:17:09 -0400, Phillip Cloud <cpcloud at gmail.com>
wrote:
> Upon getting the annoying unexpected error from the latest pyuic4 I
changed
> the following code after reading someone's hack to fix this problem in
an
> earlier release of PyQt4. Would it be possible to make `encoding` a
kwarg
> in
> the Mac OS X version of PyQt4? To fix it I did the following (I'm
running
> PyQt 4.7.6 [from MacPorts] on Mac OS X 10.6.4 [Snow Leopard]):
> 
> Line 55 (ish) in the file
>
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/uic/driver.py
> 
> if self._opts.output == "-":
>     pyfile = sys.stdout
> else:
>     if sys.platform == 'win32': # maybe if sys.platform in ['win32',
> 'cygwin']: ... instead
>         pyfile = open(self._opts.output, 'wt', encoding='utf8')
>     else:
>         pyfile = open(self._opts.output, 'wt')

Already fixed in current snapshots.

Phil


More information about the PyQt mailing list