[Pythonmac-SIG] Universal newline support in file.readlines()?

Larry Meyn Larry.A.Meyn@nasa.gov
Thu, 20 Mar 2003 08:38:20 -0800


--Apple-Mail-16--995859945
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

I use the readlines() method for file objects in many of my scripts.  
After switching to Python 2.3 (specifically the framework build 2.3.a2+ 
from the kitchen sink distro)  readlines() now seems to require that 
files have Unix newlines instead of Mac newlines.  This is really only 
an annoyance for me, since I probably won't switch back to earlier 
versions that require Mac newlines, but it could be a problem for 
people that do switch back and forth.  Is there a performance issue in 
supporting universal newlines in the readlines()?  Or am I missing 
something that makes universal newlines work in readlines()?

Larry Meyn
Aerospace Operations Modeling Office

M/S 210-10                      Phone:  (650) 604-5038
NASA Ames Research Center       Fax:    (650) 604-0222
Moffett Field, CA 94035-1000    E-mail: Larry.A.Meyn@nasa.gov
                                 E-Fax:  (425) 944-5526 sent via e-mail

--Apple-Mail-16--995859945
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

I use the readlines() method for file objects in many of my scripts. 
After switching to Python 2.3 (specifically the framework build
2.3.a2+ from the kitchen sink distro)  readlines() now seems to
require that files have Unix newlines instead of Mac newlines.  This
is really only an annoyance for me, since I probably won't switch back
to earlier versions that require Mac newlines, but it could be a
problem for people that do switch back and forth.  Is there a
performance issue in supporting universal newlines in the readlines()? 
Or am I missing something that makes universal newlines work in
readlines()?


<fontfamily><param>Courier</param>Larry Meyn

Aerospace Operations Modeling Office


M/S 210-10                      Phone:  (650) 604-5038

NASA Ames Research Center       Fax:    (650) 604-0222

Moffett Field, CA 94035-1000    E-mail: Larry.A.Meyn@nasa.gov

                                E-Fax:  (425) 944-5526 sent via e-mail

</fontfamily>
--Apple-Mail-16--995859945--