[Ipython-tickets] [IPython] #205: %run method, problems with writing to file/data corruption

IPython ipython-tickets@scipy....
Tue Dec 18 09:12:07 CST 2007


#205: %run method, problems with writing to file/data corruption
---------------------+------------------------------------------------------
 Reporter:  rjalves  |       Owner:  fperez
     Type:  defect   |      Status:  new   
 Priority:  normal   |   Milestone:        
Component:  ipython  |     Version:        
 Severity:  major    |    Keywords:        
---------------------+------------------------------------------------------
 I have a script that simply reads two different files in csv format, using
 the csv module. They are both loaded to memory, some changes happen on the
 data and then result is outputted to a single csv file, again using the
 csv module.

 Now the problem:
 When I run the script on the shell, by using python script.py, the output
 file has exactly 4225 lines. And this is the correct result.

 Inside ipython the thing gets more complicated. Running the script with
 %run script.py has two different behaviors.

 The first time the script is run, the output file has 4148 lines and the
 last line is truncated.
 If you then repeat the run command inside ipython, then the output file
 will have the correct number of lines.

 However if you delete the output file, and rerun the run command again,
 the output file will be corrupted again, and on the same place.

 I also tried to empty the file to see if the problem was something with
 creating the file, but the same thing happened.

 So to say that when run twice the output is the right one. If the output
 file is changed, then to get the right output again a double run is
 needed.

-- 
Ticket URL: <http://ipython.scipy.org/ipython/ipython/ticket/205>
IPython <http://ipython.scipy.org>
The IPython interactive Python system


More information about the Ipython-tickets mailing list