[Bf-python] OBJ import (another bug?)

Jean-Luc Peurière jlp at nerim.net
Mon Oct 4 20:43:05 CEST 2004


Le 4 oct. 04, à 22:06, Stephane SOPPERA a écrit :

> Campbell Barton wrote:
>
>> Well I did a dos2unix using nedit. open and save- then it works.
>>
>> The line seperation is done with pythons readlines so mabe there is a 
>> but with that???
>>
>> Im just saying the bug is in the readlines function, since its read 
>> as 1 line. (I tested this)
>
> Actually this file's lines are separated by only a '\r'. Usually, 
> lines are separated with a '\n' on unix and '\r\n' on windows.
> Since "\r" means that the cursor should return at the start of the 
> line without going to the next line, the following string: 
> "hello\rworld\r!" should display "!orld". I've just checked that it's 
> what python displayed when you type  print "hello\rworld\r!" on linux.
> So the obj files on the site are misformed. They are not correct 
> windows files.

They are correct obj files, created by an apple macintosh computer. 
'\r' separator is mac standard (and NeXt too. both ’\r' & '\n' are 
accepted there). As an Obj file is defined to be standard text, it uses 
the separator of the platform used to create it.

Now, that means that importers must check what is the separator used. 
That's what other software  do and why it works on them.

-- 
Jean-luc




More information about the Bf-python mailing list