Merge lp:~mvo/software-center/fix-purchase-accept-crash into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 2916
Proposed branch: lp:~mvo/software-center/fix-purchase-accept-crash
Merge into: lp:software-center
Diff against target: 13 lines (+3/-0)
1 file modified
softwarecenter/ui/gtk3/views/purchaseview.py (+3/-0)
To merge this branch: bzr merge lp:~mvo/software-center/fix-purchase-accept-crash
Reviewer Review Type Date Requested Status
Kiwinote Approve
Review via email: mp+99292@code.launchpad.net

Description of the change

This fixes a crash when doing a purchase on a system without a configuration.
To reproduce:
- rm -rf ~/.config/software-center
- open software-center
- purchases something
- observe error on the terminal after accepting the ToS dialog

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Fwiw, davmor2 tested this and it works for him.

Revision history for this message
Kiwinote (kiwinote) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/views/purchaseview.py'
2--- softwarecenter/ui/gtk3/views/purchaseview.py 2012-03-22 23:05:26 +0000
3+++ softwarecenter/ui/gtk3/views/purchaseview.py 2012-03-26 11:34:39 +0000
4@@ -138,6 +138,9 @@
5 res = show_accept_tos_dialog(get_parent(self))
6 if not res:
7 return False
8+ # config parser will not add sections automatically :/
9+ if not self.config.has_section("general"):
10+ self.config.add_section("general")
11 self.config.set("general", "accepted_tos", "yes")
12 return True
13 return True

Subscribers

People subscribed via source and target branches