sync_members bugs (possible fixes included)

Bug #265843 reported by Ericding
2
Affects Status Importance Assigned to Milestone
GNU Mailman
New
High
Unassigned

Bug Description

While trying to run sync_members in MM 2.1, I get the
following errors:

Traceback (most recent call last):
  File "/home/mailman/bin/sync_members", line 286, in ?
    main()
  File "/home/mailman/bin/sync_members", line 258, in main
    s = email.Utils.formataddr((name,
addr)).encode(enc, replace')
UnboundLocalError: local variable 'enc' referenced
before assignment

I worked around this by adding

   enc = sys.getdefaultencoding()

at line 258. But then the script throws an error while
trying to remove members! Here's the traceback:

  File "/home/mailman/bin/sync_members", line 287, in ?
    main()
  File "/home/mailman/bin/sync_members", line 276, in main
    name = mlist.getMemberName(laddr) or ''
  File "/home/mailman/Mailman/OldStyleMemberships.py",
line 128, in getMemberName
    self.__assertIsMember(member)
  File "/home/mailman/Mailman/OldStyleMemberships.py",
line 113, in __assertIsMember
    raise Errors.NotAMemberError, member
Mailman.Errors.NotAMemberError: <email address hidden>

If I change line 276 to just set name to '', then the
script completes successfully. Is it possible it's
trying to reference member name after the member has
already been deleted from the list?

Eric

[http://sourceforge.net/tracker/index.php?func=detail&aid=666235&group_id=103&atid=100103]

Revision history for this message
Ericding (ericding) wrote :

While I think my fix was sufficient, I think a more elegant
one would be to move the offending line (i.e.,
mlist.getMemberName) further up in its clause, so that it's
called before the address is deleted from the list.

Revision history for this message
Tzs-users (tzs-users) wrote :

Just ran into this one this morning too. Moving the call
to mlist.getMemberName(laddr) up to line 266 solved it for me.

Changed in mailman:
assignee: nobody → Bernard Keimel (sladev5976)
Barry Warsaw (barry)
Changed in mailman:
assignee: Bernard Keimel (sladev5976) → nobody
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.