473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1890
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sven Erik Matzen | last post by:
Hi there, I'm searching for a "convinient" way to compile my source into a multifile assembly (multiple files for one assembly). I need this to optimize performance while loading the assembly...
1
by: David Isaac | last post by:
Why is a MultiFile object not an iterator? For example if mfp = multifile.MultiFile(fp)I cannot dofor line in mfp: do_somethingRelated:MultiFile.next seems badly named.(Something like...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
12
by: Pollux | last post by:
I'm having trouble doing someting apparently simple. I'm still not very familiar with Visual Studio 2003, so apologies if I've missed something obvious. Basically my problem is the following. I...
3
by: Lord2702 | last post by:
Sun. Aug. 22, 2004 2:20 PM PT How to create multifile assembly in Managed Visual C++ ? Using VSIDE. Please do not point me to MSDN pages, I already read those pages, and it only says, that you...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
4
by: everlast | last post by:
Must i use the MAKE utility in linux bash to build multifile projects? I tried to write the usual .h and .cpp files that hold the definition and recspectively the declaration of a function, I...
1
by: =?Utf-8?B?aWduaGVucnk=?= | last post by:
In my solution, I have several C# and C++ projects. Since I need them to produce multifile assembly, I use C# and C++ command line compiler. To avoid compile error caused by redundant code in...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.