TypeError

30 views
Skip to first unread message

Rafał Wieczorek

unread,
Dec 10, 2009, 5:55:47 AM12/10/09
to rssdler
With one of my rss feeds I keep getting:

CRITICAL Unexpected Error: Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/rssdler.py", line 2079, in
main
run()
File "/usr/lib/python2.5/site-packages/rssdler.py", line 2049, in
run
rssparse(key)
File "/usr/lib/python2.5/site-packages/rssdler.py", line 1952, in
rssparse
userFunctArgs = downloadFile(ppage['entries'][i]['link'], tName,
ppage['entries'][i], dirDict)
File "/usr/lib/python2.5/site-packages/rssdler.py", line 784, in
downloadFile
size, data2 = getFileSize(data.info(), data)
File "/usr/lib/python2.5/site-packages/rssdler.py", line 634, in
getFileSize
try: tparse = bdecode(data)
File "/usr/lib/python2.5/site-packages/rssdler.py", line 916, in
bdecode
x = open(x, 'r').read()
TypeError: file() argument 1 must be (encoded string without NULL
bytes), not str


I fixed it modifying getFileSize, I have added:

except TypeError:
logging.critical(''.join((traceback.format_exc() ,
u"""File was supposed to be torrent data, but could not be
bdecoded""")))

After bdecode(data). I am not Python developer, so I dont know if this
is correct way to do it, but it works for me

box2k2

unread,
Dec 17, 2009, 5:42:11 PM12/17/09
to rssdler
Similar problem here, kept crashing while downloading the following
feed:
http://showrss.karmorra.info/rss.php?user_id=11250&hd=null&proper=1

Tried it using http://ezrss.it/feeds/ and it was successful, so
there's something in the ShowRss it's failing on.

Following advice above, I changed:
except ValueError:

to:
except TypeError:

It now works, but gives the following error, major difference now
being that it continues running :)

20091217.22:31 CRITICAL Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/rssdler.py", line 634,
in getFil$ try: tparse = bdecode(data)
File "/opt/local/lib/python2.5/site-packages/rssdler.py", line 916,


in bdecode x = open(x, 'r').read()
TypeError: file() argument 1 must be (encoded string without NULL

bytes), not s$File was supposed to be torrent data, but could not be
bdecoded

Martin

Reply all
Reply to author
Forward
0 new messages