This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pythonmeister
Recipients Richard.Christen@unice.fr, gvanrossum, pythonmeister
Date 2007-09-11.05:29:30
SpamBayes Score 0.015380128
Marked as misclassified No
Message-id <1189488572.32.0.600398771302.issue1142@psf.upfronthosting.co.za>
In-reply-to
Content
I can confirm that under Linux (Linux nx6310 2.6.22-1-mepis-smp #1 SMP
PREEMPT Wed Sep 5 22:23:08 EDT 2007 i686 GNU/Linux, SimplyMepis 7.0b3)
1. using Python 3.0a1 is _very_ slow
2. it eats all your cpu (see my post)
I did not take the time to wait for the program to finish with 3.0a1,
as my patience is limited. I don't think it would silently drop lines,
as the windows version.

To see if flushing matters, I'll try this later:

import sys
print(sys.version_info)
import time
print (time.strftime('%Y-%m-%d %H:%M:%S'))
liste=[]
start = time.time()
fichout=open('test.txt','w')
for i in xrange(85014961):
    if i%5000000==0 and i>0:
        print (i,time.time()-start)
    fichout.write(str(i)+' '*59+'\n')
    fishout.flush()
fichout.close()
print ('total lines written ',i)
print (i,time.time()-start)
print ('*'*50)
fichin=open('test.txt')
start3 = time.time()
for i,li in enumerate(fichin):
    if i%5000000==0 and i>0:
        print (i,time.time()-start3)
fichin.close()
print ('total lines read ',i)
print(time.time()-start)


I've seen a case lately on Windows XP SP2 with Python 2.3, where a
college of mine wrote some files he read from a zip file to disk.
Before the close() he also had to flush() the written files
explicitly, otherwise he was not able to rename them afterwards.
His first approach was time.sleep(30), which was not an option.
I'll come back, if I ran the code under Windows.
History
Date User Action Args
2007-09-11 05:29:32pythonmeistersetspambayes_score: 0.0153801 -> 0.015380128
recipients: + pythonmeister, gvanrossum, Richard.Christen@unice.fr
2007-09-11 05:29:32pythonmeistersetspambayes_score: 0.0153801 -> 0.0153801
messageid: <1189488572.32.0.600398771302.issue1142@psf.upfronthosting.co.za>
2007-09-11 05:29:32pythonmeisterlinkissue1142 messages
2007-09-11 05:29:30pythonmeistercreate