show_qfiles: 'str' object has no attribute 'as_string'

Bug #266319 reported by Axel Beckert
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Unassigned

Bug Description

With mailman 2.1.5 and Python 2.4 on SuSE Linux 9.3,
show_qfiles throws an error:

python show_qfiles-2.1.7.orig ~/xchange/test.pck
====================> /home/abe/xchange/test.pck
Traceback (most recent call last):
  File "show_qfiles-2.1.7.orig", line 74, in ?
    main()
  File "show_qfiles-2.1.7.orig", line 67, in main
    sys.stdout.write(msg.as_string())
AttributeError: 'str' object has no attribute 'as_string'

Removing the ".as_string()" from the source of
show_qfiles fixes the problem.

show_qfiles is still the same in 2.1.7 and still throws
this error. Tested with 2.1.7 and Python 2.4.1 under
SuSE Linux 10.0.

Patch:

--- show_qfiles-2.1.7.orig 2006-03-06
22:38:46.000000000 +0100
+++ show_qfiles-2.1.7 2006-03-06 22:40:27.000000000 +0100
@@ -64,7 +64,7 @@
         fp = open(filename)
         if filename.endswith(".pck"):
             msg = load(fp)
- sys.stdout.write(msg.as_string())
+ sys.stdout.write(msg)
         else:
             sys.stdout.write(fp.read())

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

Revision history for this message
Mark Sapiro (msapiro) wrote :

Your patch will fix the show_qfiles for those entries in the
'in' queue that have unparsed message text, but it will
break it for all other entries that have a
Mailman.Message.Message instance.

Try the attached patch and see if it isn't better. Please
report back on what does and doesn't work for you.

Revision history for this message
Mark Sapiro (msapiro) wrote :

Patch included in 2.1.8a1.

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.