Glade *.ui files not recognized due to comment line

Bug #1393247 reported by marmuta on 2014-11-16
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-distutils-extra (Ubuntu)
Undecided
Unassigned

Bug Description

Glade 3.18 likes to insert a comment as the second line that upsets auto.py. Onboard's package fails to build due to this, unless we remember to remove the offending line after every change. Could you have a look?

$ cd onboard
$ ./setup.py build
...
WARNING: the following files are not recognized by DistUtilsExtra.auto:
  ... many ...
  settings.ui

This fixes it for me:

*** /tmp/auto.py 2014-11-16 21:03:04.244604628 +0100
--- /usr/lib/python3/dist-packages/DistUtilsExtra/auto.py 2014-11-16 21:03:26.812605563 +0100
***************
*** 305,310 ****
--- 305,311 ----
          fd = open(f, 'rb')
          firstlines = fd.readline()
          firstlines += b'\n' + fd.readline()
+ firstlines += b'\n' + fd.readline()
          fd.close()
          if b'<interface' in firstlines or b'<ui version=' in firstlines:
              src_mark(src, f)

Ubuntu Vivid
python3-distutils-extra 2.38-1build1
glade 3.18.3-1

Related branches

marmuta (marmuta) wrote :
marmuta (marmuta) wrote :

It just bit me again:
https://answers.launchpad.net/onboard/+question/284286
Could someone have a look at this, please? It's not hard to fix at all.

Ubuntu Xenial
python3-distutils-extra 2.38-1build1
glade 3.18.3-1

Francesco Fumanti (frafu) wrote :

I added marmuta's solution provided in the bug description as a patch to the python-distutils-extra package currently shipping in the development version of xenial.

Afterwards, I tested it against revision 2020 of the trunk branch of Onboard. Onboard was build without error while using the patched version of python-distutils-extra. However, I don't know if the patch might break other things.

I will add the relevant files to this bug thread.

Thanks in advance to anybody looking at this.

Francesco Fumanti (frafu) wrote :
Francesco Fumanti (frafu) wrote :
Francesco Fumanti (frafu) wrote :
Francesco Fumanti (frafu) wrote :
Francesco Fumanti (frafu) wrote :

If you want me to also prepare packages of python-distutils-extra for trusty, vivid and wily, please let me know in this bug thread or by contacting me.

Martin Pitt (pitti) wrote :

Committed with a test case, thank you!

affects: python-distutils-extra → python-distutils-extra (Ubuntu)
Changed in python-distutils-extra (Ubuntu):
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-distutils-extra - 2.39-1

---------------
python-distutils-extra (2.39-1) unstable; urgency=medium

  * test/auto.py: Show exactly which modules are missing. Thanks Daniel Macks!
    (LP: #1303550)
  * Ignore comment in second line when parsing *.ui files. Thanks marmuta!
    (LP: #1393247)
  * Drop obsolete X-Python-Version.
  * Convert build systemd to pybuild.
  * Bump Standards-Version to 3.9.6.
  * debian/copyright: Rename field to "Format:".

 -- Martin Pitt <email address hidden> Wed, 03 Feb 2016 09:56:55 +0100

Changed in python-distutils-extra (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.