Traceback calling Vte.Terminal.feed_child()

Bug #1780501 reported by Brian Murray on 2018-07-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
vte2.91 (Ubuntu)
Iain Lane
Iain Lane

Bug Description

[Test Case]
1) Ensure the following packages from -updates (version 0.52.2-1ubuntu1~18.04.1) are installed on an Ubuntu 18.04 system: gir1.2-vte-2.91 libvte-2.91-0 libvte-2.91-common
2) Modify /etc/issue e.g. I changed 18.04 to 18.04.2
3) Ensure /etc/update-manager/release-upgrades contains "Prompt=normal"
4) Run /usr/lib/ubuntu-release-upgrader/check-new-release-gtk -d
5) When prompted about replacing "the customized configuration file '/etc/issue'" click Keep
6) Observe a traceback in Vte.Terminal.feed_child()

After installing the new version of vte2.91 in -proposed you should no longer receive a Traceback when clicking keep during the upgrade process.

[Regression Potential]
Per laney: "The regression potential is that I messed up the upload and everything using feed* breaks."

It'd probably be good to test guake too since it uses feed_child().

[Original Description]
I was upgrading from Bionic to Cosmic when I received a conffile prompt regarding /etc/update-initramfs/initramfs.conf, I clicked keep and then saw this Traceback:

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-filpk342/cosmic", line 8, in <module>
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 238, in main
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 1949, in run
    return self.fullUpgrade()
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 1912, in fullUpgrade
    if not self.doDistUpgrade():
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 1248, in doDistUpgrade
    res = self.cache.commit(fprogress,iprogress)
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 293, in commit
    apt.Cache.commit(self, fprogress, iprogress)
  File "/usr/lib/python3/dist-packages/apt/", line 606, in commit
    pm = apt_pkg.PackageManager(self._depcache)
  File "/usr/lib/python3/dist-packages/apt/", line 569, in install_archives
    # compat with older API
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 229, in run
    res = os.WEXITSTATUS(self.wait_child())
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 340, in wait_child
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 347, in update_interface
  File "/usr/lib/python3/dist-packages/apt/progress/", line 252, in update_interface
    if err.errno != errno.EAGAIN and err.errno != errno.EWOULDBLOCK:
  File "/tmp/ubuntu-release-upgrader-filpk342/DistUpgrade/", line 276, in conffile
    self.term.feed_child("n\n", -1)
TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

Brian Murray (brian-murray) wrote :

Calling Vte.Terminal.feed_child() with "n\n", -1 works fine with version 0.52.1-1ubuntu1 on Ubuntu 18.04 but using version in bionic-updates and cosmic I receive the following Traceback:

In [10]: term.feed_child("n\n", -1)
TypeError Traceback (most recent call last)
<ipython-input-10-aea6cb64c22b> in <module>()
----> 1 term.feed_child("n\n", -1)

TypeError: Vte.Terminal.feed_child() takes exactly 2 arguments (3 given)

In [11]:
Do you really want to exit ([y]/n)? y
[ 8:10AM 10167 ] [ bdmurray@impulse:~ ]
 $ apt-cache policy gir1.2-vte-2.91
  Installed: 0.52.2-1ubuntu1~18.04.1
  Candidate: 0.52.2-1ubuntu1~18.04.1
  Version table:
 *** 0.52.2-1ubuntu1~18.04.1 500
        500 bionic-updates/main amd64 Packages

Changed in vte2.91 (Ubuntu):
status: New → Triaged
importance: Undecided → High
tags: added: regression-update
Brian Murray (brian-murray) wrote :

Dropping the patch that appears here:

Makes Vte.Terminal.feed_child() work again, the way it has been for several releases of Ubuntu.

Brian Murray (brian-murray) wrote :

Calling feed_child() with the version of vte2.91 in bionic-updates this way works:


However, it seems that the length argument disappeared even though it continues to be documented.

Brian Murray (brian-murray) wrote :

And here is how guake deals with this:

121 def feed_child(self, resolved_cmdline):
122 if (Vte.MAJOR_VERSION, Vte.MINOR_VERSION) >= (0, 42):
123 encoded = resolved_cmdline.encode("utf-8")
124 try:
125 super().feed_child_binary(encoded)
126 except TypeError:
127 # The doc doest not say clearly at which version the feed_child* function has lost
128 # the "len" parameter :(
129 super().feed_child(resolved_cmdline, len(resolved_cmdline))
130 else:
131 super().feed_child(resolved_cmdline, len(resolved_cmdline))

Brian Murray (brian-murray) wrote :

This may end of being an issue for terminator as it calls feed_child a couple of times.

Changed in vte2.91 (Ubuntu):
assignee: nobody → Iain Lane (laney)
Changed in ubuntu-release-upgrader (Ubuntu Bionic):
status: New → Invalid
Changed in vte2.91 (Ubuntu Bionic):
status: New → Triaged
Iain Lane (laney) wrote :

It'd be much nicer if you could ask before assigning bugs to me. Thanks.

I'll ask Rico if he can take a look.

Rico Tzschichholz (ricotz) wrote :
Iain Lane (laney) wrote :

OK, my feeling is that we shouldn't fix vte2.91 for this. We had accidental downstream API differences here, which projects had to deal with and it's a good thing they don't any more.

Definitely not for cosmic, although possibly more debatable in bionic-updates. Given that, u-r-u is going to have to be fixed for this *anyway* so you might as well SRU.

Feel free to ask the SRU team and if they think we should revert that patch addition in bionic-updates I'll do it. But the discovered fix sounds like the right one for >= cosmic.

Changed in vte2.91 (Ubuntu):
status: Triaged → Won't Fix
Changed in vte2.91 (Ubuntu Bionic):
status: Triaged → Won't Fix
Iain Lane (laney) wrote :


Brian Murray (brian-murray) wrote :

I agree that having downstream API differences is bad and that it shouldn't be fixed for cosmic. However, projects / packages other than ubuntu-release-upgrader have had to do extra work because of the SRU of this in Ubuntu 18.04. See and the changes identified in guake.

We don't know how many other packages / projects have code which expects feed_child() to behave a specific way and changing that underneath them is wrong. There was some discussion in the foundations team meeting regarding the issue.

Please revert this change in Ubuntu 18.04.

Changed in vte2.91 (Ubuntu Bionic):
status: Won't Fix → Triaged
importance: Undecided → High
Iain Lane (laney) wrote :


For the record, it's not an assumption. Catching TypeError is a way to deal with the fact that there were two versions of this function around. The version of Vte in bionic, because of the MIR team's refusal to let us have PCRE 2 in main, accidentally had an API break relative to the same version released upstream. If you wanted your code to work with the same upstream version of Vte on Ubuntu and non-Ubuntu you had to deal with this.

Iain Lane (laney) wrote :

It's uploaded.

Please do test this; I gave it a bit of a go but I probably didn't exercise everything.

Iain Lane (laney) wrote :

Oh and it would be helpful if you could write the SRU description since you have the real test case and I don't. Or waive it if you want.

The regression potential is that I messed up the upload and everything using feed* breaks.

tags: added: id-5b4d29002c528628776accad
Iain Lane (laney) on 2018-07-17
Changed in vte2.91 (Ubuntu Bionic):
assignee: nobody → Iain Lane (laney)
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers