Merge lp:~evfool/update-manager/fix817785 into lp:update-manager

Proposed by Robert Roth
Status: Merged
Merged at revision: 2204
Proposed branch: lp:~evfool/update-manager/fix817785
Merge into: lp:update-manager
Diff against target: 31 lines (+4/-4)
2 files modified
DistUpgrade/DistUpgradeViewGtk.py (+2/-2)
DistUpgrade/DistUpgradeViewGtk3.py (+2/-2)
To merge this branch: bzr merge lp:~evfool/update-manager/fix817785
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+70830@code.launchpad.net

Description of the change

Fix for a crash appearing, when distUpgrade is waiting for input for a yes/no question and should forward it to the VteTerminal.
The feed_child method used in this case takes two parameters, the string to send and the length of the string. [1]
With the old python bindings, feed_child had the second parameter default to -1 (that is why it was working until now) [2], but the GObject introspection based bindings do not support the default parameter value annotation yet [3], so until it gets implemented, we have to specify the -1 value to let the function calculate the length of the string (must be null-terminated) [4].

[1] http://developer.gnome.org/vte/unstable/VteTerminal.html#vte-terminal-feed-child
[2] http://git.gnome.org/browse/vte/tree/python/vte.defs#n109
[3] https://bugzilla.gnome.org/show_bug.cgi?id=558620
[4] http://git.gnome.org/browse/vte/tree/src/vte.c#n4868

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUpgrade/DistUpgradeViewGtk.py'
2--- DistUpgrade/DistUpgradeViewGtk.py 2011-07-27 08:52:35 +0000
3+++ DistUpgrade/DistUpgradeViewGtk.py 2011-08-09 08:41:36 +0000
4@@ -253,9 +253,9 @@
5 self.time_ui += time.time() - start
6 # if replace, send this to the terminal
7 if res == gtk.RESPONSE_YES:
8- self.term.feed_child("y\n")
9+ self.term.feed_child("y\n", -1)
10 else:
11- self.term.feed_child("n\n")
12+ self.term.feed_child("n\n", -1)
13
14 def fork(self):
15 pid = self.term.forkpty(envv=self.env)
16
17=== modified file 'DistUpgrade/DistUpgradeViewGtk3.py'
18--- DistUpgrade/DistUpgradeViewGtk3.py 2011-07-27 08:52:35 +0000
19+++ DistUpgrade/DistUpgradeViewGtk3.py 2011-08-09 08:41:36 +0000
20@@ -256,9 +256,9 @@
21 self.time_ui += time.time() - start
22 # if replace, send this to the terminal
23 if res == Gtk.ResponseType.YES:
24- self.term.feed_child("y\n")
25+ self.term.feed_child("y\n", -1)
26 else:
27- self.term.feed_child("n\n")
28+ self.term.feed_child("n\n", -1)
29
30 def fork(self):
31 pty = Vte.Pty.new(Vte.PtyFlags.DEFAULT)

Subscribers

People subscribed via source and target branches

to status/vote changes: