[Bf-python] PyRun_File vs PyRun_String

Campbell Barton ideasman42 at gmail.com
Sat May 10 18:32:46 CEST 2008


Thanks, Ill mail the py/c api ml to see if there is a workaround.
Maybe there could be a function that just accepts a filename?

On Sat, May 10, 2008 at 6:29 PM, Martin Poirier <theeth at yahoo.com> wrote:
>
> --- On Sat, 5/10/08, Campbell Barton <ideasman42 at gmail.com> wrote:
>
>> From: Campbell Barton <ideasman42 at gmail.com>
>> Subject: [Bf-python] PyRun_File vs PyRun_String
>> To: "Blender Foundation Python list" <bf-python at blender.org>
>> Date: Saturday, May 10, 2008, 11:32 AM
>> Hi, yesterday I was looking into a bug where the python file
>> had
>> windows line endings converted incorrectly.
>> Now I'm left wondering why we cant use PyRun_File which
>> would be a lot
>> easier/faster, then loading the buffer and doing line
>> ending checks.
>>
>> The comments give this reason, but Im wondering if its
>> still valid.
>> Id like to know what platforms PyRun_File didnt work on or
>> maybe some
>> more details from "Python/C API Ref Manual, chapter
>> 2"
>
> The comment is very much still valid.
>
> Passing FILE structures across DLLs in windows is NOT a good idea for the aforementioned reason. Not only can it break across different C libs but it *will* break across debug/release.
>
> It could be less of an issue on platforms but I wouldn't want to take the risk.
>
> Martin
>
>
>      ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



More information about the Bf-python mailing list