Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 171701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:02:04+00:00 2026-05-11T13:02:04+00:00

I am using rss2email for converting a number of RSS feeds into mail for

  • 0

I am using rss2email for converting a number of RSS feeds into mail for easier consumption. That is, I was using it because it broke in a horrible way today: On every run, it only gives me this backtrace:

Traceback (most recent call last):   File '/usr/share/rss2email/rss2email.py', line 740, in <module>     elif action == 'list': list()   File '/usr/share/rss2email/rss2email.py', line 681, in list     feeds, feedfileObject = load(lock=0)   File '/usr/share/rss2email/rss2email.py', line 422, in load     feeds = pickle.load(feedfileObject) TypeError: (''str' object is not callable', 'sxOYAAuyzSx0WqN3BVPjE+6pgPU', ((2009, 3, 19, 1, 19, 31, 3, 78, 0), {})) 

The only helpful fact that I have been able to construct from this backtrace is that the file ~/.rss2email/feeds.dat in which rss2email keeps all its configuration and runtime state is somehow broken. Apparently, rss2email reads its state and dumps it back using cPickle on every run.

I have even found the line containing that 'sxOYAAuyzSx0WqN3BVPjE+6pgPU'string mentioned above in the giant (>12MB) feeds.dat file. To my untrained eye, the dump does not appear to be truncated or otherwise damaged.

What approaches could I try in order to reconstruct the file?

The Python version is 2.5.4 on a Debian/unstable system.

EDIT

Peter Gibson and J.F. Sebastian have suggested directly loading from the pickle file and I had tried that before. Apparently, a Feed class that is defined in rss2email.py is needed, so here’s my script:

#!/usr/bin/python  import sys # import pickle import cPickle as pickle sys.path.insert(0,'/usr/share/rss2email') from rss2email import Feed  feedfile = open('feeds.dat', 'rb') feeds = pickle.load(feedfile) 

The ‘plain’ pickle variant produces the following traceback:

Traceback (most recent call last):   File './r2e-rescue.py', line 8, in <module>     feeds = pickle.load(feedfile)   File '/usr/lib/python2.5/pickle.py', line 1370, in load     return Unpickler(file).load()   File '/usr/lib/python2.5/pickle.py', line 858, in load     dispatch[key](self)   File '/usr/lib/python2.5/pickle.py', line 1133, in load_reduce     value = func(*args) TypeError: 'str' object is not callable 

The cPickle variant produces essentially the same thing as calling r2e itself:

Traceback (most recent call last):   File './r2e-rescue.py', line 10, in <module>     feeds = pickle.load(feedfile) TypeError: (''str' object is not callable', 'sxOYAAuyzSx0WqN3BVPjE+6pgPU', ((2009, 3, 19, 1, 19, 31, 3, 78, 0), {})) 

EDIT 2

Following J.F. Sebastian’s suggestion around putting ‘printf debugging’ into Feed.__setstate__ into my test script, these are the last few lines before Python bails out.

          u'http:/com/news.ars/post/20080924-everyone-declares-victory-in-smutfree-wireless-broadband-test.html': u'http:/com/news.ars/post/20080924-everyone-declares-victory-in-smutfree-wireless-broadband-test.html'},  'to': None,  'url': 'http://arstechnica.com/'} Traceback (most recent call last):   File './r2e-rescue.py', line 23, in ?     feeds = pickle.load(feedfile) TypeError: (''str' object is not callable', 'sxOYAAuyzSx0WqN3BVPjE+6pgPU', ((2009, 3, 19, 1, 19, 31, 3, 78, 0), {})) 

The same thing happens on a Debian/etch box using python 2.4.4-2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:02:05+00:00Added an answer on May 11, 2026 at 1:02 pm

    How I solved my problem

    A Perl port of pickle.py

    Following J.F. Sebastian’s comment about how simple the pickle format is, I went out to port parts of pickle.py to Perl. A couple of quick regular expressions would have been a faster way to access my data, but I felt that the hack value and an opportunity to learn more about Python would be be worth it. Plus, I still feel much more comfortable using (and debugging code in) Perl than Python.

    Most of the porting effort (simple types, tuples, lists, dictionaries) went very straightforward. Perl’s and Python’s different notions of classes and objects has been the only issue so far where a bit more than simple translation of idioms was needed. The result is a module called Pickle::Parse which after a bit of polishing will be published on CPAN.

    A module called Python::Serialise::Pickle existed on CPAN, but I found its parsing capabilities lacking: It spews debugging output all over the place and doesn’t seem to support classes/objects.

    Parsing, transforming data, detecting actual errors in the stream

    Based upon Pickle::Parse, I tried to parse the feeds.dat file. After a few iteration of fixing trivial bugs in my parsing code, I got an error message that was strikingly similar to pickle.py‘s original object not callable error message:

    Can't use string ("sxOYAAuyzSx0WqN3BVPjE+6pgPU") as a subroutine ref while "strict refs" in use at lib/Pickle/Parse.pm line 489, <STDIN> line 187102. 

    Ha! Now we’re at a point where it’s quite likely that the actual data stream is broken. Plus, we get an idea where it is broken.

    It turned out that the first line of the following sequence was wrong:

    g7724 ((I2009 I3 I19 I1 I19 I31 I3 I78 I0 t(dtRp62457 

    Position 7724 in the "memo" pointed to that string "sxOYAAuyzSx0WqN3BVPjE+6pgPU". From similar records earlier in the stream, it was clear that a time.struct_time object was needed instead. All later records shared this wrong pointer. With a simple search/replace operation, it was trivial to fix this.

    I find it ironic that I found the source of the error by accident through Perl’s feature that tells the user its position in the input data stream when it dies.

    Conclusion

    1. I will move away from rss2email as soon as I find time to automatically transform its pickled configuration/state mess to another tool’s format.
    2. pickle.py needs more meaningful error messages that tell the user about the position of the data stream (not the poision in its own code) where things go wrong.
    3. Porting parts pickle.py to Perl was fun and, in the end, rewarding.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 85k
  • Answers 85k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It should be straightforward to write a wrapper class that… May 11, 2026 at 5:09 pm
  • Editorial Team
    Editorial Team added an answer List has a variableRowHeight property that is set to false… May 11, 2026 at 5:09 pm
  • Editorial Team
    Editorial Team added an answer You could do this with a series of nested queries:… May 11, 2026 at 5:09 pm

Related Questions

I am using SQL Server 2005. I have a table with a text column
I am using LINQ to query a generic dictionary and then use the result
I am using Hibernate in a Java application to access my Database and it
I am using MSBuild to build my stuff. I want to use CruiseControl.net as

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.