Package: python-kde4-dev Version: 4:4.2.0-1 Severity: important Tags: patch
Using the pykdeuic4 the generated python script doesn't contain a coding header. When someone uses unicode characters >127 at the qt-designer the generated python code contains them as-is. This makes it an invalid python script. This is easily fixed by adding a one-line header at the python code. The attached patch fixes this simple bug. As a bonus it also fixes another problem: The generated file starts with an empty line. This isn't proper for scripts starting with "#!". The patch also removes this extra line. -- System Information: Debian Release: 5.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.28-v2-v (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages python-kde4-dev depends on: ii python 2.5.2-3 An interactive high-level object-o ii python-qt4 4.4.4-3 Python bindings for Qt4 Versions of packages python-kde4-dev recommends: ii python-kde4 4:4.2.0-1 Python bindings for the KDE 4 libr python-kde4-dev suggests no packages. -- debconf-show failed
diff -Nur kdebindings-4.2.0.orig/python/pykde4/tools/pykdeuic4/pykdeuic4.py kdebindings-4.2.0/python/pykde4/tools/pykdeuic4/pykdeuic4.py --- kdebindings-4.2.0.orig/python/pykde4/tools/pykdeuic4/pykdeuic4.py 2008-01-05 01:52:57.000000000 +0200 +++ kdebindings-4.2.0/python/pykde4/tools/pykdeuic4/pykdeuic4.py 2009-02-01 15:48:56.328735555 +0200 @@ -24,8 +24,9 @@ from PyQt4.uic.Compiler import indenter, compiler from PyQt4.uic.Compiler import qtproxies -header = """ -#!/usr/bin/env python +header = """#!/usr/bin/env python +# coding=UTF-8 +# # Generated by pykdeuic4 from %s on %s # # WARNING! All changes to this file will be lost.