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
=== modified file 'DistUpgrade/DistUpgradeViewGtk.py'
--- DistUpgrade/DistUpgradeViewGtk.py 2011-07-27 08:52:35 +0000
+++ DistUpgrade/DistUpgradeViewGtk.py 2011-08-09 08:41:36 +0000
@@ -253,9 +253,9 @@
253 self.time_ui += time.time() - start253 self.time_ui += time.time() - start
254 # if replace, send this to the terminal254 # if replace, send this to the terminal
255 if res == gtk.RESPONSE_YES:255 if res == gtk.RESPONSE_YES:
256 self.term.feed_child("y\n")256 self.term.feed_child("y\n", -1)
257 else:257 else:
258 self.term.feed_child("n\n")258 self.term.feed_child("n\n", -1)
259 259
260 def fork(self):260 def fork(self):
261 pid = self.term.forkpty(envv=self.env)261 pid = self.term.forkpty(envv=self.env)
262262
=== modified file 'DistUpgrade/DistUpgradeViewGtk3.py'
--- DistUpgrade/DistUpgradeViewGtk3.py 2011-07-27 08:52:35 +0000
+++ DistUpgrade/DistUpgradeViewGtk3.py 2011-08-09 08:41:36 +0000
@@ -256,9 +256,9 @@
256 self.time_ui += time.time() - start256 self.time_ui += time.time() - start
257 # if replace, send this to the terminal257 # if replace, send this to the terminal
258 if res == Gtk.ResponseType.YES:258 if res == Gtk.ResponseType.YES:
259 self.term.feed_child("y\n")259 self.term.feed_child("y\n", -1)
260 else:260 else:
261 self.term.feed_child("n\n")261 self.term.feed_child("n\n", -1)
262262
263 def fork(self):263 def fork(self):
264 pty = Vte.Pty.new(Vte.PtyFlags.DEFAULT)264 pty = Vte.Pty.new(Vte.PtyFlags.DEFAULT)

Subscribers

People subscribed via source and target branches

to status/vote changes: