Type
bug
Priority
minor
Status
resolved
Watchers
2

Revelation 0.4.11 on Fedora 7: export to password safe v.2 fails

Steve Singer avatarSteve Singer created an issue

I tried to export a password file to my Gnome desktop.

Judging from this diagnostic, one of my entries has an empty user name field--possibly one for my Linksys router:

Traceback (most recent call last):

File "/usr/bin/revelation", line 182, in <lambda> action.connect("activate", lambda w: self.file_export())

File "/usr/bin/revelation", line 1348, in file_export datafile.save(self.entrystore, file, password)

File "/usr/lib/python2.5/site-packages/revelation/io.py", line 125, in save file_write(file, self.handler.export_data(entrystore, password))

File "/usr/lib/python2.5/site-packages/revelation/datahandler/pwsafe.py", line 577, in export_data edata += create_field(e[entry.UsernameField].encode(enc, "replace"), FIELDTYPE_USER) AttributeError: 'NoneType' object has no attribute 'encode'

Sorry, but I would not be comfortable shipping my data file to pinpoint the problem. ;-)

--Steve Singer

Comments (7)

    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

    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

  1. Steve Singer

    Thanks.

    NB: in RedHat distributions, this patch should be applied to:

    /usr/lib/python#.#/site-packages/revelation/datahandler/pwsafe.py

    For Fedora 7:

    /usr/lib/python2.5/site-packages/revelation/datahandler/pwsafe.py

  2. Log in to comment »
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.