From: sturlamolden on
On 7 Jul, 21:47, "Martin v. Loewis" <mar...(a)v.loewis.de> wrote:

> However, the C standard is silent wrt. to PyMem_MALLOC, and it certainly
> allows the definition of macros which use the macro arguments more than
> once.

Ok, I knew there was something odd here. PyMem_Malloc is indeed a
function, whilst PyMem_MALLOC is a deprecated macro.

:)






From: Christian Heimes on
> Yeah, but then we're down to file descriptors, C library locales and such as the
> remaining problems.

Don't forget errno! Every CRT might have its own errno thread local. I
don't know how its handled on Windows but I suspect it suffers from the
same problem.

Christia

From: sturlamolden on
On 7 Jul, 22:26, Christian Heimes <li...(a)cheimes.de> wrote:

> Don't forget errno! Every CRT might have its own errno thread local. I
> don't know how its handled on Windows but I suspect it suffers from the
> same problem.

The Windows API "errno" is GetLastError. But a delinquent CRT might
map GetLastError() to other integers.



From: Christian Heimes on
> The main problem that the required MSVC redistributables are not necessarily
> present on the end user's system.

It's not a problem for Python anymore. It took a while to sort all
problems out. Martin and other developers have successfully figured out
how to install the CRT for system wide and local user installations. A
system wide installation installs the CRT in the side by side cache
(WinSxS). A local installation keeps the msvcrt90.dll and the
Microsoft.VC90.CRT.manifest next to the python.exe. Python extensions no
longer embed a manifest so they share the CRT from the python.exe process.

In order to ship a standalone exe you have to keep the CRT next to your
exe. This should work for py2exe binaries as well. At our company we
install our application stack entirely from subversion including Python
2.6.5, Sun JRE and lots of other stuff. This works perfectly fine for us
even for servers without the MSVCRT redistributable.

Christian

From: sturlamolden on
On 7 Jul, 23:33, "Martin v. Loewis" <mar...(a)v.loewis.de> wrote:

> > The Windows API "errno" is GetLastError. But a delinquent CRT might
> > map GetLastError() to other integers.
>
> Please check the source before posting. msvcrt defines errno as

I don't have the source to msvcrt, at least not to my knowledge.