AttributeError: 'NoneType' object has no attribute 'replace'

Bug #120371 reported by Marius Gedminas
2
Affects Status Importance Assigned to Milestone
Revelation - obsolete
New
Unknown
revelation (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: revelation

I imported a MyPasswordSafe file, clicked on one of the entries, and got an error dialog with this traceback:

Traceback (most recent call last):
  File "/usr/bin/revelation", line 413, in <lambda>
    self.tree.selection.connect("changed", lambda w: self.entryview.display_entry(self.entrystore.get_entry(self.tree.get_active())))
  File "/usr/lib/python2.5/site-packages/revelation/ui.py", line 1929, in display_entry
    widget = generate_field_display_widget(field, self.config, self.clipboard)
  File "/usr/lib/python2.5/site-packages/revelation/ui.py", line 200, in generate_field_display_widget
    widget = Label(util.escape_markup(field.value))
  File "/usr/lib/python2.5/site-packages/revelation/util.py", line 155, in escape_markup
    string = string.replace("&", "&amp;")
AttributeError: 'NoneType' object has no attribute 'replace'

Tags: patch
Revision history for this message
Vaida Bogdan (vaidab) wrote :

I think is similar to my bug report at http://svn.codepoet.no/revelation/ticket/285 . Maybe you should add your trace there too.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I'm certain that that's a different bug, but adding mine to the upstream bug tracker seems like a good idea.

Changed in revelation:
status: Unknown → New
Revision history for this message
Dave Love (fx-gnu) wrote :

I made it work with this patch to
/usr/share/pycentral/revelation/site-packages/revelation/util.py,
but I don't know if it's the right fix.

Revision history for this message
ghostonline (ghostonline-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Thanks in advance.

Changed in revelation (Ubuntu):
status: New → Incomplete
Revision history for this message
Vaida Bogdan (vaidab) wrote :

I switched to Mac OS X so I can't test this again.

Revision history for this message
ghostonline (ghostonline-deactivatedaccount) wrote :

I cannot reproduce the bug and as the original reporter is unable to test the new version of Revelation, I will mark this report as invalid.

Changed in revelation (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Stuart Rackham (srackham) wrote :

I had the same problem (Revelation 0.4.11, Ubuntu 8.04), fixed /usr/share/pyshared/revelation/datahandler/pwsafe.py with this patch:

--- pwsafe.py.BAK 2007-05-22 19:56:39.000000000 +1200
+++ pwsafe.py 2010-01-11 13:34:22.000000000 +1300
@@ -574,7 +574,10 @@
                                edata += create_field(uuid, FIELDTYPE_UUID)
                                edata += create_field(self.__get_group(entrystore, iter), FIELDTYPE_GROUP)
                                edata += create_field(e.name.encode(enc, "replace"), FIELDTYPE_TITLE)
- edata += create_field(e[entry.UsernameField].encode(enc, "replace"), FIELDTYPE_USER)
+ s = e[entry.UsernameField]
+ if s is None:
+ s = ""
+ edata += create_field(s.encode(enc, "replace"), FIELDTYPE_USER)
                                edata += create_field(e[entry.PasswordField].encode(enc, "replace"), FIELDTYPE_PASSWORD)
                                edata += create_field(e.description.encode(enc, "replace"), FIELDTYPE_NOTES)
                                edata += create_field("", FIELDTYPE_END)

-- Stuart Rackham

Revision history for this message
Stuart Rackham (srackham) wrote :

Here's the patch as an attachment:

-- Stuart Rackham

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.