[Csv] Something's fishy w/ Mac line endings...

Andrew McNamara andrewm at object-craft.com.au
Mon Aug 18 08:35:12 CEST 2003


>I wrote:
>
>    Looking at the problem a bit, I see this call chain:
>
>        Reader_iternext ->
>            PyIter_Next ->
>                file_iternext ->
>                    readahead_get_line_skip
>
>On second thought, I think the problem may be that we're calling PyIter_Next
>at all.  That's probably only supposed to work if the file is opened in text
>mode.  Since we expect files to be opened in binary mode, Reader_iternext
>should probably be doing its own EOL detection based upon the setting of the
>lineterminator.  That's a lot of extra labor, but may be the correct
>solution.

I think the intention was that by using PyIter_Next, we'd get the advantage
of the universal EOL support in 2.3 - in which case, maybe we should drop
our own EOL detection...

I wonder if the user's problems go away when they open their file in text
mode?

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/


More information about the Csv mailing list