469,580 Members | 1,865 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,580 developers. It's quick & easy.

Multifile EOF error

Hi,

I had error in my script like "sudden EOF in MultiFile readline()"
Why such error occur

Mar 20 '06 #1
2 1699
In <11**********************@t31g2000cwb.googlegroups .com>,
av******@gmail.com wrote:
I had error in my script like "sudden EOF in MultiFile readline()"
Why such error occur


Because there's something wrong.

Sorry but you have to give a little more detail about your script and the
exact error you see.

Try to trim down your script to the minimal code that produces the error
and post both. Copy'n'paste code and traceback, don't retype it.

Ciao,
Marc 'BlackJack' Rintsch
Mar 20 '06 #2
> Try to trim down your script to the minimal code that produces the error
and post both. Copy'n'paste code and traceback, don't retype it.

The code is kinda bit long so you can see the whole idea. I use some
libgmail and twisted web

#code start
def displayComment(request):
gmc = libgmail.GmailAccount(gmailacc, gmailpasswd)
try:
gmc.login()
except:
request.write("Cannot feed comment now, sorry")
for tkey, tvals in request.args.items():
if tkey == "tiddler":
for tval in tvals:
tidlabel = tval
else:
request.write("Wrong url setting in the commen plugin")
fold = gmc.getMessagesByLabel(tidlabel)
for thread in fold:
for msg in thread:
msource = msg.source
cmess = str(feedComment(msource))
print "abis manggil feed"
fcmess = join(cmess)
def feedComment(fsrcs):
print fsrcs
srcsw = file("/tmp/srcs" + magic + ".tmp_", "w") #creating and
write the mess source
srcsw.write(fsrcs)
srcsw.close()
srcs = file("/tmp/srcs" + magic + ".tmp_", "r")
dstfile = file("/tmp/" + magic + ".tmp","w")
src = multifile.MultiFile(srcs,0)
print "diatas header"
headers = mimetools.Message(src, src.seekable)
print "dibawah header"
if headers.getmaintype() != "multipart":
print "message is not multipart :("
boundary = headers.getparam("boundary")
if not boundary:
print "meesage boundary not specified"
src.push(boundary)
src.next()
headers = mimetools.Message(src, src.seekable)
encode = headers.getencoding()
if not encode:
print "Unknown encoding mail"
mimetools.decode(src, dstfile, encode)
dstfile.close()
dstread = file("/tmp" + magic + ".tmp", "r")
mess = dstread.read()
#removing all the file generated in the tmp dir
os.remove("/tmp/srcs" + magic + ".tmp_")
os.remove("/tmp" + magic + ".tmp")
return mess +"\n\n"
#end of code

the error that I get is

Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/twisted/internet/selectreactor.py",
line 133, in doSelect
_logrun(selectable, _drdw, selectable, method, dict)
File "/usr/lib/python2.4/site-packages/twisted/python/log.py", line
56, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/lib/python2.4/site-packages/twisted/python/log.py", line
41, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python2.4/site-packages/twisted/python/context.py",
line 31, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File
"/usr/lib/python2.4/site-packages/twisted/internet/selectreactor.py",
line 139, in _doReadOrWrite
why = getattr(selectable, method)()
File "/usr/lib/python2.4/site-packages/twisted/internet/tcp.py", line
351, in doRead
return self.protocol.dataReceived(data)
File "/usr/lib/python2.4/site-packages/twisted/protocols/basic.py",
line 221, in dataReceived
why = self.lineReceived(line)
File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line
961, in lineReceived
self.allContentReceived()
File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line
1002, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/lib/python2.4/site-packages/twisted/web/http.py", line
557, in requestReceived
self.process()
File "libgmail-0.1.4/servetiddly.py", line 180, in process
handler(self)
File "libgmail-0.1.4/servetiddly.py", line 149, in displayComment
cmess = str(feedComment(msource))
File "libgmail-0.1.4/servetiddly.py", line 118, in feedComment
src.next()
File "/usr/lib/python2.4/multifile.py", line 120, in next
while self.readline(): pass
File "/usr/lib/python2.4/multifile.py", line 80, in readline
raise Error, 'sudden EOF in MultiFile.readline()'
multifile.Error: sudden EOF in MultiFile.readline()

Mar 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sven Erik Matzen | last post: by
1 post views Thread by David Isaac | last post: by
12 posts views Thread by Pollux | last post: by
3 posts views Thread by Lord2702 | last post: by
7 posts views Thread by p | last post: by
1 post views Thread by =?Utf-8?B?aWduaGVucnk=?= | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.