[Mailman-Users] more prune_arch errors
Con Wieland
cwieland at uci.edu
Wed Sep 26 17:27:06 CEST 2012
Now it processes some but I now get:
./prune_arch -l mgsa-l -d 1095 -bpnv
Processing mgsa-l mailbox
Traceback (most recent call last):
File "./prune_arch", line 191, in ?
main()
File "./prune_arch", line 156, in main
mdate = msg['date'] and mktime_tz(parsedate_tz(msg['date']))
TypeError: string indices must be integers
My "date' command gives this format Wed Sep 26 08:21:50 PDT 2012
con
On Sep 25, 2012, at 2:07 PM, Mark Sapiro wrote:
> Con Wieland wrote:
>>
>> I just found this very useful looking script but am getting the following errors when I try running it.
>>
>> ./prune_arch -l mgsa-l -d 1095 -n
>> Traceback (most recent call last):
>> File "./prune_arch", line 191, in ?
>> main()
>> File "./prune_arch", line 156, in main
>> mdate = mktime_tz(parsedate_tz(msg['date']))
>> File "/usr/local/mailman/pythonlib/email/_parseaddr.py", line 140, in mktime_tz
>> if data[9] is None:
>> TypeError: unsubscriptable object
>>
>> Any help would be appreciated
>
>
> The issue is the script didn't take into account messages in the
> mailbox without Date: headers. The scripts at
> <http://www.msapiro.net/scripts/prune_arch> and
> <http://fog.ccsf.cc.ca.us/~msapiro/scripts/prune_arch> have been
> updated.
>
> The fix is to change line 156 from
>
> mdate = mktime_tz(parsedate_tz(msg['date']))
>
> to
>
> mdate = msg['date'] and
> mktime_tz(parsedate_tz(msg['date']))
>
> (watch out for wrapping above)
>
> --
> Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
> San Francisco Bay Area, California better use your sense - B. Dylan
>
> ------------------------------------------------------
> Mailman-Users mailing list Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users
> Mailman FAQ: http://wiki.list.org/x/AgA3
> Security Policy: http://wiki.list.org/x/QIA9
> Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
> Unsubscribe: http://mail.python.org/mailman/options/mailman-users/cwieland%40uci.edu
More information about the Mailman-Users
mailing list