curl-and-python

Re: Crash in test_write_to_file_via_object()

From: Oleg Pudeyev <oleg+pycurl_at_bsdpower.com>
Date: Mon, 23 Dec 2013 22:37:47 -0500

On Tue, 24 Dec 2013 00:30:56 +0100
"Gisle Vanem" <gvanem_at_yahoo.no> wrote:

> I got the nose-tests to run. At least when I got the required
> packages to install. Thank to easy_install. The crash now is at
> 'test_write_to_file_via_object
> (tests.write_to_file_test.WriteToFileTest)'
>
> This is an iteration of the CRT-issue; Curl_client_write() calls
> fwrite() on a file it didn't open with it's CRT (msvc100). But rather
> Python's CRT (msvcr90).

Well, yes. I guess you can't take just any libcurl.dll - it has to be
built against the same crt as the python you are going to be using it
with.

Which means including libcurl.dll in pycurl packages now sounds like a
very good idea.

Luckily I already wrote code to convert WRITEDATA to WRITEFUNCTION
options for python 3 which no longer exposes python files as C FILE
pointers. That same code can be used on python 2, but with a
performance penalty compared to giving libcurl a FILE pointer I would
imagine.

> Commenting out 'test_write_to_file_via_function()' and
> 'test_write_to_file_via_object()' in write_to_file_test.py, no tests
> crashes.

What's wrong with test_write_to_file_via_function? That one should work.

Oleg

--
Please remove +pycurl when mailing me privately.
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2013-12-24