On 4/29/26 12:01 PM, Craig Leres via Mailman-users wrote:
Ah. So when I thought I set the list pw, I didn't understand how "mailman shell" worked. Now I find that I cannot actually set it (see appended stack trace). ... mm 299 % mailman shell Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
from zope.component import getUtility from mailman.interfaces.listmanager import IListManager
The above two lines are unnecessary because mailman shell in interactive mode imports those things. See below.
listspec = 'test.example.com' mlist = getUtility(IListManager).get(listspec) pw = '????????????' mlist.moderator_password = config.password_context.encrypt(pw)
This needs to be
mlist.moderator_password = config.password_context.encrypt(pw).encode()
to make it bytes. It needs to be bytes because of the way the column is defined in the mailinglist model. It works as a string in the doctests at <https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rules/docs/...> because in those fragments the list object is never saved to a database.
The following illustrates all the names defined when mailman shell is invoked interactively.
$ mailman shell Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not.
dir() ['ALL_TEMPLATES', 'ALT_TEMPLATE_NAMES', 'ALWAYS_REPLY', 'AcceptEvent', 'AcceptOwnerEvent', 'Action', 'AddressAlreadyLinkedError', 'AddressError', 'AddressNotLinkedError', 'AddressVerificationEvent', 'AlreadySubscribedError', 'ArchivePolicy', 'ArchiveRenderingMode', 'BadDomainSpecificationError', 'BounceContext', 'ChainEvent', 'ClobberDate', 'ConfigurationUpdatedEvent', 'ContinueProcessing', 'DMARCMitigateAction', 'DatabaseError', 'DeliveryMode', 'DeliveryStatus', 'DigestFrequency', 'DiscardEvent', 'DiscardMessage', 'DomainCreatedEvent', 'DomainCreatingEvent', 'DomainDeletedEvent', 'DomainDeletingEvent', 'DuplicateStyleError', 'EmailError', 'ExistingAddressError', 'FilterAction', 'FilterType', 'HoldEvent', 'IAPI', 'IAcceptableAlias', 'IAcceptableAliasSet', 'IAddress', 'IArchiver', 'IAutoResponseRecord', 'IAutoResponseSet', 'IBan', 'IBanManager', 'IBounceEvent', 'IBounceProcessor', 'ICLISubCommand', 'ICacheManager', 'IChain', 'IChainIterator', 'IChainLink', 'IConfiguration', 'IContentFilter', 'IDatabase', 'IDatabaseFactory', 'IDomain', 'IDomainManager', 'IEmailCommand', 'IEmailResults', 'IEmailValidator', 'IHandler', 'IHeaderMatch', 'IHeaderMatchList', 'ILanguage', 'ILanguageManager', 'IListArchiver', 'IListArchiverSet', 'IListManager', 'IListRequests', 'IMailTransportAgentAliases', 'IMailTransportAgentDelivery', 'IMailTransportAgentLifecycle', 'IMailingList', 'IMember', 'IMembershipManager', 'IMessage', 'IMessageStore', 'IMutableChain', 'IOneLastDigest', 'IPendable', 'IPended', 'IPendedKeyValue', 'IPendings', 'IPipeline', 'IPlugin', 'IPreferences', 'IRoster', 'IRule', 'IRunner', 'IStyle', 'IStyleManager', 'ISubscriptionManager', 'ISubscriptionService', 'ISwitchboard', 'ITemplate', 'ITemplateLoader', 'ITemplateManager', 'IUser', 'IUserManager', 'IWorkflowState', 'IWorkflowStateManager', 'InvalidConfigurationError', 'InvalidEmailAddressError', 'InvalidListNameError', 'LinkAction', 'ListAlreadyExistsError', 'ListCreatedEvent', 'ListCreatingEvent', 'ListDeletedEvent', 'ListDeletingEvent', 'MailmanError', 'MemberRole', 'MembershipChangeEvent', 'MembershipError', 'MembershipIsBannedError', 'MissingConfigurationFileError', 'MissingPreferredAddressError', 'MissingUserError', 'NewsgroupModeration', 'NoSuchListError', 'NotAMemberError', 'PasswordChangeEvent', 'PendType', 'Personalization', 'RejectEvent', 'RejectMessage', 'ReplyToMunging', 'RequestRecord', 'RequestType', 'Response', 'ResponseAction', 'RunnerCrashEvent', 'RunnerInterrupt', 'SomeRecipientsFailed', 'SubscriptionConfirmationNeededEvent', 'SubscriptionEvent', 'SubscriptionInvitationNeededEvent', 'SubscriptionMode', 'SubscriptionPendingError', 'SubscriptionPolicy', 'TokenOwner', 'TooManyMembersError', 'UnrecognizedBounceDisposition', 'UnsubscriptionConfirmationNeededEvent', 'UnsubscriptionEvent', 'UnverifiedAddressError', '__builtins__', 'abort', 'commit', 'config', 'getUtility', 'm']
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan